关于本电子书

About This eBook

ePUB 是一种开放的行业标准电子书格式。但是,对 ePUB 及其许多功能的支持因阅读设备和应用程序而异。使用您的设备或应用程序设置根据您的喜好自定义演示文稿。您可以自定义的设置通常包括字体、字体大小、单列或双列、横向或纵向模式,以及您可以单击或点击以放大的图形。有关阅读设备或应用程序上的设置和功能的其他信息,请访问设备制造商的网站。

ePUB is an open, industry-standard format for eBooks. However, support of ePUB and its many features varies across reading devices and applications. Use your device or app settings to customize the presentation to your liking. Settings that you can customize often include font, font size, single or double column, landscape or portrait mode, and figures that you can click or tap to enlarge. For additional information about the settings and features on your reading device or app, visit the device manufacturer’s Web site.

许多标题包括编程代码或配置示例。要优化这些元素的呈现方式,请在单列横向模式下查看电子书,并将字体大小调整到最小设置。除了以可重排的文本格式呈现代码和配置外,我们还提供了模仿印刷书中演示文稿的代码图像;因此,如果可重排格式可能会影响代码列表的表示,您将看到“单击此处查看代码图像”链接。单击该链接可查看打印保真度代码图像。要返回上一页查看,请单击设备或应用程序上的 Back 按钮。

Many titles include programming code or configuration examples. To optimize the presentation of these elements, view the eBook in single-column, landscape mode and adjust the font size to the smallest setting. In addition to presenting code and configurations in the reflowable text format, we have included images of the code that mimic the presentation found in the print book; therefore, where the reflowable format may compromise the presentation of the code listing, you will see a “Click here to view code image” link. Click the link to view the print-fidelity code image. To return to the previous page viewed, click the Back button on your device or app.

数字信号处理基本指南

The Essential Guide to Digital Signal Processing

理查德 G. 莱昂斯

D. 李富格尔

Richard G. Lyons

D. Lee Fugal

Image

新泽西州上马鞍河 • 波士顿 • 印第安纳波利斯 • 纽约旧金山

• 多伦多 • 蒙特利尔 • 伦敦 • 慕尼黑 • 巴黎 • 马德里

开普敦 • 悉尼 • 东京 • 新加坡 • 墨西哥城



Upper Saddle River, NJ • Boston • Indianapolis • San Francisco

New York • Toronto • Montreal • London • Munich • Paris • Madrid

Capetown • Sydney • Tokyo • Singapore • Mexico City

制造商和卖家用来区分其商品的许多名称都声称是商标。如果这些名称出现在本书中,并且出版商知道商标索赔,则这些名称已使用首字母大写字母或全部大写字母印刷。

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.

作者和出版商在编写本书时已谨慎行事,但不作任何形式的明示或暗示的保证,也不对错误或遗漏承担任何责任。对于与使用此处包含的信息或程序有关或由此引起的附带或间接损害,我们不承担任何责任。

The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.

有关批量购买此出版物的信息,或特殊销售机会(可能包括电子版、定制封面设计以及特定于您的业务、培训目标、营销重点或品牌兴趣的内容),请致电 corpsales@pearsoned.com 或 (800) 382-3419 联系我们的公司销售部门。

For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at corpsales@pearsoned.com or (800) 382-3419.

有关政府销售的咨询,请联系 governmentsales@pearsoned.com

For government sales inquiries, please contact governmentsales@pearsoned.com.

有关美国境外销售的问题,请联系 international@pearsoned.com

For questions about sales outside the U.S., please contact international@pearsoned.com.

请访问我们的网站:informit.com/aw

Visit us on the Web: informit.com/aw

美国国会图书馆出版物编目数据

Lyons, Richard G.,1948 年 –

数字信号处理基本指南/Richard G. Lyons, D. Lee Fugal。

页 cm

包括索引。

ISBN-13: 978-0-13-380442-3 (alk. paper)

ISBN-10: 0-13-380442-9 (alk. paper)

1.信号处理 -- 数字技术。I. 富格尔,D. 李。II. 标题。

TK5102.9.L958 2014

621.3852'2—dc23 2014006918

Library of Congress Cataloging-in-Publication Data

Lyons, Richard G., 1948–

The essential guide to digital signal processing/Richard G. Lyons, D. Lee Fugal.

    pages  cm

 Includes index.

 ISBN-13: 978-0-13-380442-3 (alk. paper)

 ISBN-10: 0-13-380442-9 (alk. paper)

1. Signal processing--Digital techniques. I. Fugal, D. Lee. II. Title.

  TK5102.9.L958 2014

  621.3852’2—dc23                                                                                      2014006918

版权所有 © 2014 Pearson Education, Inc.

Copyright © 2014 Pearson Education, Inc.

保留所有权利。在美国印刷。本出版物受版权保护,在以任何形式或任何方式(电子、机械、影印、录制或类似方式)进行任何禁止的复制、存储在检索系统中或传输之前,必须获得出版商的许可。要获得使用本作品资料的许可,请向 Pearson Education, Inc. 提交书面请求,地址为 Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458,或者您可以将您的请求传真至 (201) 236-3290。

All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use material from this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request to (201) 236-3290.

ISBN-13: 978-0-13-380442-3

ISBN-10: 0-13-380442-9
在美国印第安纳州克劳福德斯维尔的 RR Donnelley 用再生纸印刷
的文本。

首次印刷,2014 年 5 月

ISBN-13: 978-0-13-380442-3

ISBN-10: 0-13-380442-9

Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana.

First printing, May 2014

执行编辑

Bernard Goodwin

Executive Editor

Bernard Goodwin

执行编辑

John Fuller

Managing Editor

John Fuller

项目编辑

Elizabeth Ryan

Project Editor

Elizabeth Ryan

文案编辑

Deborah Thompson

Copy Editor

Deborah Thompson

校对

员 Christine Clark

Proofreader

Christine Clark

编辑助理

Michelle Housley

Editorial Assistant

Michelle Housley

封面设计师

holiday palace

Cover Designer

Chuti Prasertsith

合成器

Shepherd, Inc.

Compositor

Shepherd, Inc.

内容

Contents

前言

Preface

1 什么是数字信号处理?

1 What Is Digital Signal Processing?

Phantom 技术

The Phantom Technology

什么是信号?

What Is a Signal?

模拟信号和数字信号?

Analog and Digital Signals?

数字信号处理

Digital Signal Processing

您应该记住什么

What You Should Remember

2 个模拟信号

2 Analog Signals

什么是模拟信号?

What Is an Analog Signal?

温度模拟信号

A Temperature Analog Signal

音频模拟信号

An Audio Analog Signal

电气模拟信号

An Electrical Analog Signal

什么是电压?

What Is an Electrical Voltage?

正弦波电压

Sinusoidal Wave Voltages

其他有用的周期性模拟信号

Other Useful Periodic Analog Signals

人类语音模拟信号

A Human Speech Analog Signal

您应该记住什么

What You Should Remember

3 模拟信号的频率和频谱

3 Frequency and the Spectra of Analog Signals

频率

Frequency

每秒周期数

Cycles per Second

每秒弧度数

Radians per Second

频谱的概念

The Concept of Spectrum

模拟信号频谱

Analog Signal Spectra

复合信号频谱示例

A Composite-Signal Spectral Example

谐波

Harmonics

谐波失真

Harmonic Distortion

带宽

Bandwidth

其他带宽

The Other Bandwidth

您应该记住什么

What You Should Remember

4 数字信号及其生成方式

4 Digital Signals and How They Are Generated

什么是数字信号?

What Is a Digital Signal?

数字化的概念

The Notion of Digital

数字信号:定义 #1

Digital Signals: Definition #1

数字信号:定义 #2

Digital Signals: Definition #2

数字信号是如何产生的

How Digital Signals Are Generated

通过观察生成数字信号

Digital Signal Generation by Observation

通过软件生成数字信号

Digital Signal Generation by Software

通过对模拟信号进行采样来生成数字信号

Digital Signal Generation by Sampling an Analog Signal

数字信号的采样率

The Sample Rate of a Digital Signal

语音数字信号

A Speech Digital Signal

数字信号处理示例

An Example of Digital Signal Processing

数字信号处理的另一个例子

Another Example of Digital Signal Processing

模拟信号采样的两个重要方面

Two Important Aspects of Sampling Analog Signals

采样率限制

Sample Rate Restriction

模数转换器输出编号

Analog-to-Digital Converter Output Numbers

采样率转换

Sample Rate Conversion

抽取

Decimation

插值

Interpolation

您应该记住什么

What You Should Remember

5 采样和数字信号频谱

5 Sampling and the Spectra of Digital Signals

模拟信号频谱 — 快速回顾

Analog Signal Spectra—A Quick Review

采样如何影响数字信号的频谱

How Sampling Affects the Spectra of Digital Signals

对振荡量进行采样的恶作剧

The Mischief in Sampling Oscillating Quantities

模拟正弦波电压采样

Sampling Analog Sine Wave Voltages

为什么我们关心 Aliasing

Why We Care about Aliasing

数字正弦波信号的频谱

The Spectrum of a Digital Sine Wave Signal

数字语音信号的频谱

The Spectrum of a Digital Voice Signal

数字音乐信号的频谱

The Spectrum of a Digital Music Signal

抗锯齿滤镜

Anti-Aliasing Filters

模数转换器输出编号

Analog-to-Digital Converter Output Numbers

您应该记住什么

What You Should Remember

6 我们如何计算数字信号频谱

6 How We Compute Digital Signal Spectra

计算数字光谱

Computing Digital Spectra

离散傅里叶变换

The Discrete Fourier Transform

快速傅里叶变换

The Fast Fourier Transform

光谱计算示例

A Spectral Computation Example

计算

The Computations

计算的含义

What the Computations Mean

光谱分析示例

A Spectral Analysis Example

您应该记住什么

What You Should Remember

7 小波

7 Wavelets

快速傅里叶变换 (FFT) — 快速回顾

The Fast Fourier Transform (FFT)—A Quick Review

连续小波变换 (CWT)

The Continuous Wavelet Transform (CWT)

未抽取或冗余离散小波变换 (UDWT/RDWT)

Undecimated or Redundant Discrete Wavelet Transforms (UDWT/RDWT)

传统(抽取)离散小波变换 (DWT)

Conventional (Decimated) Discrete Wavelet Transforms (DWT)

您应该记住什么

What You Should Remember

8 个数字滤波器

8 Digital Filters

模拟滤波

Analog Filtering

通用筛选器类型

Generic Filter Types

数字滤波

Digital Filtering

您应该记住什么

What You Should Remember

9 个二进制数

9 Binary Numbers

数字系统

Number Systems

十进制数,一种以 10 为基数的数字系统

Decimal Numbers, a Base-10 Number System

以 4 为基数的数字系统

A Base-4 Number System

二进制数,一种以 2 为基数的数字系统

Binary Numbers, a Base-2 Number System

在家中使用二进制数

Using Binary Numbers at Home

二进制数据

Binary Data

为什么使用二进制数?

Why Use Binary Numbers?

数字硬件易于构建

Digital Hardware Is Easy to Build

二进制数据不易降级

Binary Data Is Resistant to Degradation

二进制数和模数转换器

Binary Numbers and Analog-to-Digital Converters

您应该记住什么

What You Should Remember

科学记数法

A Scientific Notation

B 分贝

B Decibels

用于描述声功率值的分贝

Decibels Used to Describe Sound Power Values

用于测量地震的分贝

Decibels Used to Measure Earthquakes

用于描述信号振幅的分贝

Decibels Used to Describe Signal Amplitudes

用于描述滤波器的分贝

Decibels Used to Describe Filters

C AM 和 FM 无线电信号

C AM and FM Radio Signals

AM 无线电信号

AM Radio Signals

FM 无线电信号

FM Radio Signals

比较 AM 和 FM 收音机

Comparing AM and FM Radio

D 二进制数格式

D Binary Number Formats

无符号二进制数格式

Unsigned Binary Number Format

符号幅度二进制数格式

Sign-Magnitude Binary Number Format

二进制补码二进制数格式

Two’s Complement Binary Number Format

偏移二进制数格式

Offset Binary Number Format

备用二进制数表示法

Alternate Binary Number Notation

八进制二进制数表示法

Octal Binary Number Notation

十六进制二进制数表示法

Hexadecimal Binary Number Notation

词汇表

Glossary

指数

Index

前言

Preface

我们都熟悉 signal 这个词,它传达信息,例如交通信号、遇险信号,甚至烟雾信号。在某些纸牌游戏中,我们甚至尝试发出信号,当我们拿到一手好牌时。但是处理信号意味着什么?本书旨在使用您已经熟悉的信号和信号处理的真实示例,尽可能清晰简单地为您回答这个问题。

We’re all familiar with the word signal as something that conveys information such as traffic signals, distress signals, or even smoke signals. In certain card games, we even try not to signal when we’ve been dealt a good hand. But what does it mean to process a signal? This book is written to answer that question for you as clearly and simply as possible, using real-world examples of signals and signal processing with which you are already familiar.

虽然我们通常没有意识到这一点,但我们的日常生活经常受到信号和信号处理的影响。这本书不仅展示了为什么会这样,而且进一步解释了为什么 FM 收音机的音频听起来比您从手机听到的音频好得多。

Although we don’t often realize it, our daily lives are routinely influenced by signals and signal processing. This book not only shows why this is so, but goes further, to explain, for example, why the audio from an FM radio sounds so much better than the audio you hear from your cell phone.

本书面向非技术人员,而不是工科学生。因此,本书有两个主要目标:以易于理解的方式用最少的数学知识描述信号和信号处理的基本概念,并向读者介绍信号处理的语言(行话)。(为了帮助读者,本书的末尾包含了 Signal Processing 术语和首字母缩略词的综合词汇表。

This book is intended for nontechnical people rather than engineering students. As such, the book has two main objectives: to describe the fundamental concepts of signals and signal processing in an understandable way with a minimum of mathematics, and to introduce the reader to the language—the lingo—of signal processing. (To aid the reader, a comprehensive glossary of signal processing terminology and acronyms is included at the end of the book.)

Image

特别是,对于那些与生产或使用信号处理硬件或软件的公司有关的非技术读者,我们向您表示最大的同情。您将接触到大量神秘的概念和术语。这本书将消除这个谜团,以便您可以进一步了解信号处理,并更有效地与工程师和其他技术人员进行沟通。

In particular, for those nontechnical readers who are involved with companies that produce or use signal processing hardware or software, you have our utmost sympathy. You are exposed to a vast array of mysterious concepts and terminology. This book will remove that mystery so you can further understand signal processing and more effectively communicate with engineers and other technical people.

事实证明,信号的主题可以分为两大类:模拟信号和数字信号。这本书缓慢而温和地解释了这两种类型的信号的性质,以及它们如何用于提高我们的生活质量。

As it turns out, the topic of signals can be divided into two main categories: analog signals and digital signals. This book slowly and gently explains the nature of both types of signals and how they are used to improve the quality of our lives.

我们以我们认为合理的章节进展方式编写了这本书,但没有必要按顺序阅读这些章节,甚至没有必要阅读所有章节。第 1 章解释了信号处理在现代如何以及为何变得如此重要。第 2 章到第 5 章描述了模拟和数字信号的性质,而其他章节涵盖了对模拟和数字信号执行的处理操作的主题。

We’ve written this book in what we think is a sensible progression of chapters, but it’s not necessary to read the chapters in order, or even to read all of them. Chapter 1 explains how and why signal processing has become so important in modern times. Chapters 2 through 5 describe the nature of analog and digital signals, while the other chapters cover the topics of the processing operations performed on analog and digital signals.

说了这么多,请知道您的作者和出版商站在您这边。我们希望您喜欢这本书并觉得它有用!

Having said all of that, please know your authors and publisher are on your side. We hope you enjoy this book and find it useful!

1. 什么是数字信号处理?

1. What Is Digital Signal Processing?

Phantom 技术

The Phantom Technology

数字信号处理 (DSP) 技术以最重要的方式影响了我们的现代生活。如果您看电视、连接到互联网、使用数码相机、拨打手机、开车、在家用计算机的键盘上打字或使用签帐卡或借记卡,那么您就是在利用 DSP。事实上,DSP 是所有这些设备中的技术大脑。虽然我们每天利用 DSP 数十次,但很少有人听说过数字信号处理,这种奇怪的情况就是 DSP 被称为幻影技术的原因。为了说明我们对这种无形 DSP 技术的依赖程度,表 1.1 提供了一个简短的列表,列出了没有 DSP 的生活会是什么样子。

The technology of digital signal processing (DSP) has affected our modern lives in the most significant ways. If you watch television, connect to the Internet, use a digital camera, make a cell phone call, drive a car, type on the keyboard of a home computer, or use a charge or debit card, you are taking advantage of DSP. In fact, DSP is the technical brains in all those devices. Although we take advantage of DSP dozens of times a day, very few people have ever heard of digital signal processing and this strange situation is why DSP has been called a phantom technology. To show how much we depend on this invisible DSP technology, Table 1.1 provides a short list of what life would be like without DSP.

Image

表 1.1没有数字信号处理的生活

Table 1.1 Life without Digital Signal Processing

鉴于我们现在意识到 DSP 在我们的日常生活中的重要性,我们有理由问这个东西叫什么 DSP 技术。要理解数字信号处理一词的含义,我们必须首先解释信号一词的含义。

Given that we now realize how important DSP is in our daily lives, it’s reasonable to ask just what is this thing called DSP technology. To understand the meaning of the phrase digital signal processing, we must first explain what we mean by the word signal.

什么是信号?

What Is a Signal?

信号这个词的任何完整定义都必须有些模糊。例如,有些人将信号定义为传达给接收者的任何信息表示。与其讨论这些定义词的含义,不如通过考虑我们在日常生活中经历的信号示例来澄清信号这个词对我们的意义。例如,当我们听扬声器发出的音乐时,我们会体验到声波形式的信号,它会在空气中传播,刺激我们的耳膜。当我们把车开到交通路口时,红绿灯发出的信号灯告诉我们是应该停车还是继续前进。如果我们无视红灯,我们会发现另一个红灯跟着我们走在路上,警笛提醒我们靠边停车!

Any complete definition of the word signal must be, by necessity, somewhat vague. For example, some people define a signal as any representation of information conveyed to a receiver. Rather than discussing the meanings of those defining words, let’s clarify what the word signal means to us by considering examples of signals that we’ve experienced in our daily lives. For example, when we listen to music produced by a loudspeaker, we’re experiencing a signal in the form of sound waves traveling through the air that stimulates our eardrums. When we drive our cars to a traffic intersection, a light signal radiated by a red or green traffic light tells us whether we should stop or proceed. And if we ignore the red light, we find another red light following us down the road with a siren to signal us to pull over!

当您想拨打手机时,手机屏幕上的符号(如图 1-1 所示)是一个视觉指示器,表明您的手机正在从本地手机信号塔接收到足够强的无线电信号。温度计水银柱的高度是指示温度的视觉信号。当我们在脸颊上收到一个吻时,这是一个表达爱意的触觉信号。所有这些示例都是接收传达信息的信号的实例。

When you want to make a cell phone call, the symbol on your phone’s screen, shown in Figure 1-1, is a visual indicator that your phone is receiving a sufficiently strong radio signal from a local cell phone tower. The height of a thermometer’s mercury column is a visual signal indicating temperature. When we receive a kiss on the cheek, that’s a tactile signal of affection. All of these examples are instances of receiving a signal that conveys information.

Image

图 1-1手机信号强度指示器。

Figure 1-1 Cell phone signal-strength indicator.

模拟信号和数字信号?

Analog and Digital Signals?

事实证明,所有信号都属于两大类之一,即模拟信号数字信号。我们在日常生活中遇到的信号,上一节中提到的声音和光信号的例子,都是模拟信号第 2 章第 3 章更详细地讨论了模拟信号。

As it turns out, all signals fall into one of two major categories, analog signals and digital signals. The signals that we experience in our daily lives, the examples of sound and light signals mentioned in the previous section, are analog signals. Chapters 2 and 3 discuss analog signals in more detail.

奇怪的是,数字信号只不过是数字序列。确实如此,这些数字序列可以存储在计算机、数码相机和视频游戏机的电子存储器中,或者录制在 CD 和 DVD 上。信号处理工程师已经开发出一种将模拟信号(如声音或光信号)转换为数字信号(数字序列)的方法。数字信号包含原始模拟信号的所有信息。此外,信号处理工程师还开发了将数字信号转换回模拟信号(声音或光)的方法。将模拟信号转换为数字信号,然后将数字信号转换回模拟信号似乎不太有用,但这就是数字信号处理的用武之地。

Strangely enough, digital signals are nothing more than sequences of numbers. It’s true—sequences of numbers that can be stored in the electronic memories of computers, digital cameras, and video game machines, or recorded on CDs and DVDs. Signal processing engineers have developed a way to convert analog signals, such as a sound or light signal, into digital signals (sequences of numbers). The digital signals contain all the information of the original analog signals. In addition, signal processing engineers have also developed the means to convert a digital signal back into an analog signal (sound or light). Converting an analog signal to a digital signal and then converting the digital signal back into an analog signal doesn’t seem too useful, but that’s where digital signal processing comes in.

数字信号处理

Digital Signal Processing

数字信号处理是对数字信号数值的数学操作,它以某种有利的方式改变数字信号。例如,假设一位歌手对着麦克风唱歌,我们将该模拟语音信号转换为数字信号。接下来,可以修改数字信号中数字的值,这样当修改后的数字信号转换回模拟信号并通过扬声器播放时,我们会在歌声中听到轻微的回声,从而给我们带来更悦耳的声音。操纵流行歌手的声音是当今音乐行业的标准操作程序。我们将在第 4 章中更详细地讨论该主题。

Digital signal processing is the mathematical manipulation of the numerical values of a digital signal that changes the digital signal in some advantageous way. For example, let’s say a vocalist is singing into a microphone and we convert that analog voice signal to a digital signal. Next, the values of the numbers in the digital signal can be modified such that when the modified digital signal is converted back to an analog signal and played through a loudspeaker, we hear a slight echo in the singing that gives us a more pleasant sound. Manipulating pop singers’ voices is standard operating procedure in today’s music business. We discuss that topic in more detail in Chapter 4.

对于数字信号处理的更严重示例,请考虑进行心电图(EKG 或 ECG)测试,以检查心脏的电活动是否有问题。贴在胸前的小电极可检测心脏产生的模拟电信号,通常如图 1-2(a) 所示。由于各种实际原因,模拟电极信号受到突然的、不需要的信号电平波动(称为噪声)的污染,使医生无法评估您心脏的电活动。

For a more serious example of digital signal processing, consider undergoing an electrocardiogram (EKG or ECG) test to check for problems with the electrical activity of your heart. Small electrodes, taped to your chest, detect an analog electrical signal produced by your heart that often looks like that shown in Figure 1-2(a). For various practical reasons, the analog electrode signal is contaminated with abrupt, unwanted signal-level fluctuations, called noise, making it impossible for a doctor to evaluate your heart’s electrical activity.

Image

图 1-2心电图信号: (a) 原始测得的噪声信号;(b) 改进了数字信号处理后的信号显示。

Figure 1-2 Electrocardiogram signals: (a) original measured noisy signal; (b) improved signal display after digital signal processing.

今天,数字信号处理可以提供帮助。如图 1-3 所示,模拟电传感器信号转换为数字信号。接下来,以消除信号中不需要的噪声部分的方式修改数字信号中的数值。结果是清晰的心电图显示,如图 1-2(b) 所示,使医生能够快速评估您的心脏健康状况

Today, digital signal processing comes to the rescue. As shown in Figure 1-3, the analog electrical sensor signal is converted to a digital signal. Next, the numerical values in the digital signal are modified in a way that eliminates the unwanted noise portion of the signal. The result is a clean EKG display, as shown in Figure 1-2(b), enabling a doctor to quickly evaluate the health of your heart

Image

图 1-3使用数字信号处理来改善心电图信号显示。

Figure 1-3 Using digital signal processing to improve an electrocardiogram signal display.

DSP 的其他应用包括军事、工业、太空探索、摄影、通信、科学、地震、天气等等。正如我们之前在表 1.1 中所示,如果没有 DSP 的好处,生活将继续。但是,我们将不得不放弃我们目前享受的如此多的便利。

Other applications for DSP include military, industrial, space exploration, photography, communications, scientific, seismic, weather and many more. As we showed earlier in Table 1.1, life would go on without the benefits of DSP. However, we would have to do without so very many conveniences that we currently enjoy.

好了,我们对模拟和数字信号以及数字信号处理的超级简要介绍到此结束。在后面的章节中,我们将了解有关信号和信号处理的更多详细信息。

OK, this concludes our super-brief introduction to analog and digital signals, and digital signal processing. In later chapters, we’ll learn more details about signals and signal processing.

您应该记住什么

What You Should Remember

本章中应记住的概念是:

The concepts you should remember from this chapter are:

• 我们在日常生活中都会遇到信号,通常以模拟声光信号的形式出现。

• We experience signals throughout our daily lives, usually in the form of analog sound and light signals.

• 有一种方法可以将模拟信号 (如声音或光信号) 转换为存储在电子设备中的数字信号 (数字序列)。数字信号包含原始模拟信号的所有信息。

• There is a way to convert analog signals, such as sound or light signals, into digital signals (sequences of numbers) that are stored in an electronic device. The digital signals contain all the information of the original analog signals.

• 数字信号中的数字可以进行数学修改,以改善信号的某些重要特性,或减少污染信号的不需要的噪声。

• The numbers in a digital signal can be mathematically modified to improve some important characteristic of the signal, or reduce unwanted noise that contaminates it.

• 如有必要,可以将处理(修改和改进)的数字信号转换回模拟信号。

• The processed (modified and improved) digital signal can be converted back into an analog signal if necessary.

• DSP 的应用多种多样。我们可能并不总是看到 DSP 的这种幻影技术在哪里使用,但如果没有它,我们的生活将大不相同。

• The applications of DSP are many and varied. We may not always see where this phantom technology of DSP is used, but our lives would be very different without it.

2. 模拟信号

2. Analog Signals

正如我们在上一章中所说,了解数字信号处理的第一步是了解模拟信号。考虑到这一点,本章的目标是定义和解释模拟信号的性质。

As we stated in the last chapter, the first step in understanding digital signal processing is to learn about analog signals. With that thought in mind, the goal of this chapter is to define and explain the nature of analog signals.

什么是模拟信号?

What Is an Analog Signal?

在我们的目的中,模拟信号被定义为物理量的任何表示形式,其中

For our purposes an analog signal is defined as any representation of a physical quantity that

• 值通常随时间变化,

• typically varies in value over time,

• 在所有时刻都有一个值,并且

• has a value at all instants in time, and

• 包含信息。

• contains information.

这些特征似乎有点神秘,但实际上并非如此。您每天都会遇到模拟信号。从手机扬声器发出的音频、从电视有线电视公司到达的电视频信号、户外温度计在一天内的水银柱高度以及闪烁的夜星波动的光强度都是模拟信号的示例。模拟信号的一个重要方面是它们包含对我们有意义的信息。话虽如此,让我们详细看一下一些模拟信号。

Those characteristics seem a little mysterious but they’re really not. You experience analog signals every day. The audio emanating from your cell phone speaker, the electrical video signal arriving from your television cable company, the height of the mercury column in an outdoor thermometer over a period of one day, and the fluctuating light intensity from a twinkling nighttime star are all examples of analog signals. An important aspect of analog signals is that they contain information that can be meaningful to us. With that said, let’s look at a few analog signals in detail.

温度模拟信号

A Temperature Analog Signal

作为模拟信号的一个简单示例,图 2-1 中的温度曲线表示密歇根州马凯特市一年内室外温度的最高和最低温度。我们可以将这些曲线视为模拟信号,它们表示随时间变化的物理量。对于那一年中的任何一天,我们都可以查看曲线并估计马凯特的室外温度高低。那些图 2-1 模拟信号曲线包含哪些信息?他们告诉我们,如果我们在寒冷的天气里感到不舒服,我们不应该接受密歇根州马凯特的工作机会。

As a simple example of an analog signal, the temperature curves in Figure 2-1 represent the high and low outdoor temperatures in Marquette, Michigan, over a period of one year. We can think of those curves as analog signals—they represent physical quantities that vary over time. For any given day of that year, we can look at the curves and estimate Marquette’s high and low outdoor temperatures. And just what information do those Figure 2-1 analog signal curves contain? They tell us that if we’re uncomfortable in cold weather we shouldn’t accept a job offer in Marquette, Michigan.

Image

图 2-1密歇根州马凯特的室外温度高低。

Figure 2-1 High and low outdoor temperatures in Marquette, Michigan.

模拟信号的一个要求是,当在一张纸上绘制时,时间在水平轴上表示,如图 2-1 所示,钢笔或铅笔的尖端永远不会离开纸张表面。曲线中没有间隙,没有缺失信息。这样的曲线可以称为连续曲线。事实上,许多工程师将模拟信号称为连续信号

A requirement for analog signals is that when drawn on a piece of paper, with time represented on the horizontal axis as shown in Figure 2-1, the tip of the pen or pencil never leaves the surface of the paper. There are no gaps, no missing information, in the curve. Such a curve can be called a continuous curve. In fact, many engineers refer to analog signals as continuous signals.

音频模拟信号

An Audio Analog Signal

模拟信号的另一个示例是从扬声器发出的音频信号,如图 2-2(a) 所示。扬声器的纸锥响应施加到扬声器电气端子的音频电压,振动进出。图 2-2(b) 显示了由锥体振动引起的气压波动波。该图右侧的深色阴影带表示高气压波,中间的白色区域表示低气压。

Another example of an analog signal is an audio signal emanating from a loudspeaker such as that shown in Figure 2-2(a). The speaker’s paper cone, in response to an audio electrical voltage applied to the speaker’s electrical terminals, vibrates in and out. Figure 2-2(b) shows waves of air pressure fluctuations caused by the cone’s vibration. The dark shaded bands on the right side of that figure indicate waves of high air pressure, with the intermediate white areas representing low air pressure.

Image

图 2-2音频音调模拟声波:(a) 扬声器;(b) 扬声器和发射的气压波;(c) 随着时间的流逝,波动气压进入人耳的音叉波。

Figure 2-2 Audio tone analog sound wave:(a) loudspeaker; (b) loudspeaker and emanating air pressure waves; (c) tuning-fork wave of fluctuating air pressure entering a human ear as time passes.

当扬声器发出的声音是单一的音频音调时,如音叉产生的音调,可以如图 2-2(c) 所示,进入听众耳朵的波动气压波可以描述。当扬声器锥体向外移动时,它会压缩空气分子,从而产生一个小的高气压区域。然后,当扬声器锥体向内移动时,它会产生一个小的低气压区域。因此,扬声器产生压缩和稀薄空气分子的辐射区域,即从扬声器传播到听众耳朵的高低压气波。

When sound coming from a loudspeaker is a single audio tone, like the tone produced by a tuning fork, the fluctuating air pressure waves entering the listener’s ears can be depicted as shown in Figure 2-2(c). When the loudspeaker cone moves outward, it compresses air molecules creating a small region of high air pressure. Then, when the loudspeaker cone moves inward, it creates a small region of low air pressure. Thus, the loudspeaker produces radiating regions of compressed and rarefied air molecules, waves of high and low air pressure that travel from the loudspeaker to the listener’s ears.

人耳对这些波动的气压波很敏感。当这些波进入我们的耳朵时,电信号会传输到我们的大脑,只有这样我们才会体验到声音的感觉。

Human ears are sensitive to these waves of fluctuating air pressure. When these waves enter our ears, an electrical signal is transmitted to our brains and only then do we experience the sensation of sound.


顺便一提

By the Way

回答一个流行的问题,如果我们将声音定义为气压的移动波动,那么是的,一棵树倒在树林里,附近没有人,确实会发出声音。如果我们将声音定义为由我们的内耳机制传输到我们大脑的电信号,那么不,那棵倒在树林里的树不会发出声音。

To answer a popular question, if we define sound as traveling fluctuations in air pressure, then yes, a tree falling in the woods with no one nearby does indeed make a sound. If we define sound to be the electrical signal transmitted by the mechanisms of our inner ears to our brains, then no, that tree falling in the woods makes no sound.


电气模拟信号

An Electrical Analog Signal

事实证明,工程师们很久以前就发明了一种对气压波动敏感的机械装置。当放置在行进声波的路径中时,该设备的输出在受到高气压时为正电压,当受到低气压时输出为负电压。这个设备称为麦克风。工程师和技术人员可以通过将麦克风的输出电缆连接到称为示波器的电子仪器来查看麦克风产生的模拟电压,如图 2-3(a) 所示。示波器显示屏上的纵轴代表电压,横轴代表时间。

As it turns out, engineers long ago invented a mechanical device that is sensitive to fluctuations in air pressure. When placed in the path of a traveling sound wave, the output of this device is a positive voltage when it is subjected to high air pressure and a negative voltage when it experiences low air pressure. This device is called a microphone. Engineers and technicians can view the analog voltage a microphone produces by connecting a microphone’s output cable to an electronic instrument known as an oscilloscope, shown in Figure 2-3(a). The vertical axis on the oscilloscope’s display represents voltage and the horizontal axis represents time.

Image

图 2-3查看麦克风的输出:(a) 现代示波器(由 Tektronix Inc. 提供);(b) 显示麦克风输出的模拟电压波形的音叉声音。

Figure 2-3 Viewing a microphone’s output: (a) a modern oscilloscope (courtesy of Tektronix Inc.); (b) displayed microphone output analog voltage waveform of a tuning-fork sound.

如果图 2-2(c) 中的音叉声波到达麦克风,并且麦克风的输出电缆连接到示波器的输入端口,则示波器的显示屏将显示如图 2-3(b) 所示的电压信号。任何时刻的电压称为电压波形幅度,表示其瞬时能量。图 2-3(b) 中的峰值正电压称为波形的峰值幅度。高峰值幅度波形比低峰值幅度波形具有更多的能量。

If the tuning-fork sound wave in Figure 2-2(c) arrives at a microphone and the microphone’s output cable is connected to the input port of an oscilloscope, then the scope’s display would show the voltage signal as depicted in Figure 2-3(b). The voltage at any instant in time is called the amplitude of the voltage waveform and indicates its instantaneous energy. The peak positive voltage in Figure 2-3(b) is called the peak amplitude of the waveform. High peak-amplitude waveforms have more energy than low peak-amplitude waveforms.

麦克风的输出电压(代表气压波动)是一个模拟信号,因为它

The microphone’s output voltage, representing fluctuations in air pressure, is an analog signal because it

• 具有随时间变化的振幅,

• has an amplitude that varies as time passes,

• 在所有时刻都有一个值 (电压值在连续曲线中平滑变化,没有间隙),并且

• has a value at all instants in time (the voltage value changes smoothly in a continuous curve, with no gaps), and

• 包含峰谷电压差和频率 (每秒振荡次数) 等信息。

• contains information such as peak-to-trough voltage difference and frequency (oscillations per second).

同样,图 2-3(b) 中的曲线是音叉产生的图 2-2(b) 声波的电压表示。因此,我们可以说图 2-3(b) 电压信号类似于或在空气中传播的声波。我们将图中的曲线称为波动电压。由于我们感兴趣的许多实际模拟信号都采用模拟电压信号的形式,因此让我们暂停片刻,考虑一下电压的含义。

Again, the curve in Figure 2-3(b) is a voltage representation of the Figure 2-2(b) sound wave produced by a tuning fork. Thus, we can say that the Figure 2-3(b) voltage signal is analogous to, or the analogue of, the sound wave traveling in air. We referred to the curve in the figure as a fluctuating voltage. Because so many of the real-world analog signals that interest us take the form of analog voltage signals, let’s pause for a moment and consider what is meant by voltage.

什么是电压?

What Is an Electrical Voltage?

我们可以将电压视为一种具有称为伏特的计量单位的电压。如果有机会,该压力会导致电流(电子)流动。图 2-4(a) 通过简单的手电筒电池、开关和灯泡电路说明了这个概念。相对于电池的负极,电池正极的电压为 +1.5 伏。(同样,相对于电池的正极,电池负极的电压为 –1.5 伏。在图 2-4(a) 中,开关是开(关)的,这意味着电子没有路径从电池的负极流过电线到电池的正极。因此,没有电压(零伏)施加到灯泡上,灯泡也不亮。

We can think of a voltage as a kind of electrical pressure having units of measure called volts. That electric pressure, given the opportunity, can cause electrical current (electrons) to flow. Figure 2-4(a) illustrates this notion with a simple flashlight battery, switch, and lightbulb circuit. There is a voltage of +1.5 volts at the positive end of the battery with respect to the negative end of the battery. (Likewise, there is a voltage of –1.5 volts at the negative end of the battery with respect to the positive end of the battery.) In Figure 2-4(a), the switch is open (off), meaning that there is no path for electrons to flow through the wire from the negative terminal of the battery to the positive terminal of the battery. As a result, there is no voltage, zero volts, applied to the lightbulb and the bulb is not lit.

Image

图 2-4灯泡两端的电压:(a) 开关打开;(b) 开关关闭。

Figure 2-4 Voltage across a lightbulb: (a) switch open; (b) switch closed.

当开关闭合时,如图 2-4(b) 所示,现在有一条电气路径,电子电流从电池的负极顺时针流过电线到其正极,在灯泡端子上施加 +1.5 伏电压,灯泡亮起。具体来说,电子电流流过灯泡,灯泡的灯丝变成白热,发出可见光。

When the switch is closed, as shown in Figure 2-4(b), there is now an electrical path for electron current to flow through the wire clockwise from the negative terminal of the battery to its positive terminal, a +1.5 volt voltage is applied across the lightbulb terminals, and the bulb is lit. Specifically, electron current flows through the lightbulb and the bulb’s filament becomes white hot, emitting visible light.

当开关闭合时,如图 2-4(b) 所示,施加到灯泡上的 +1.5 伏电压称为直流电压。首字母缩略词 DC 代表直流电,对我们来说,直流电压仅是指随着时间的推移保持恒定值的电压。

When the switch is closed, as in in Figure 2-4(b), the +1.5 volt voltage applied to the lightbulb is referred to as a DC voltage. The acronym DC stands for direct current, and for us DC voltage merely means a voltage that remains constant in value as time passes.

让我们考虑另一个电池/灯泡场景。如果我们将图 2-4 的电池转过来,反转它的极性,然后关闭开关,那么电子电流就会逆时针方向流动,如图 2-5 所示。在这种情况下,电压表在灯泡端子上测量的电压为负 –1.5 伏。(白炽灯泡产生可见光,而与流经其灯丝的电流方向无关。

Let’s consider another battery/lightbulb scenario. If we turned Figure 2-4’s battery around, reversing its polarity, and closed the switch, then electron current would flow in a counterclockwise direction as shown in Figure 2-5. In that case, the voltmeter measures a negative –1.5 volts across the bulb’s terminals. (Incandescent lightbulbs generate visible light regardless of the direction of current flow through their filaments.)

Image

图 2-5施加到灯泡的电压,电池极性相反,开关闭合。

Figure 2-5 Voltage applied to a lightbulb with reversed battery polarity and switch closed.


顺便一提

By the Way

首字母缩略词 DC 已有 100 多年的历史。在 1880 年代后期,发电领域的先驱们在争论是否应该使用恒定直流电(DC,仅沿一个方向流动的电流)或交流电(AC,流动方向交替的电流)来为称为灯泡的奇妙新发明供电。美国著名发明家托马斯·爱迪生 (Thomas Edison) 为直流电大力倡导。然而,工业巨头乔治·威斯汀豪斯 (George Westinghouse) 和他曾经的员工尼古拉·特斯拉 (Nikola Tesla) 坚信,在欧洲开创的交流电是将电力引入美国家庭的最佳方式。交流电最终赢得了这场战斗,因为直流发电站只能为位于直流发电站 1 英里(1.6 公里)范围内的建筑物供电。交流电的波动性使其能够通过使用位于选定电线杆顶部的变压器进行更远的距离传输。

The acronym DC is well over 100 years old. In the late 1880s, the pioneers in the field of generating electricity were in fierce competition over whether a constant direct current (DC, current with a flow in one direction only) or an alternating current (AC, current with a flow that alternates back and forth in direction) should be used to power the wonderful new invention called the lightbulb. Famous American inventor Thomas Edison vigorously campaigned on behalf of direct current. However, industrial giant George Westinghouse and his one-time employee Nikola Tesla were convinced that AC current, pioneered in Europe, was the best way to bring electricity to American homes. AC eventually won the battle because DC power generation stations could only supply power to buildings located within 1 mile (1.6 km) of the DC power station. The fluctuating nature of AC electrical power enables it to be transmitted over much longer distances by using the transformers located at the top of selected utility poles.


图 2-42-5 中可以学习两个概念。首先,电压是一种压力,当施加到某些硬件组件(灯泡)时,它确实对我们起作用。如果图 2-4 中的灯泡被低压电动机取代,那么关闭开关会导致电动机转动。这就是电池供电的螺丝刀的工作原理。其次,电压具有与之相关的极性,如图 2-4(b)2-5 中的电压表读数所示。

There are two concepts to learn from Figures 2-4 and 2-5. First, voltage is an electrical pressure that, when applied to some hardware component (the lightbulb), does work for us. If the lightbulb in Figure 2-4 were replaced by a low-voltage electric motor, then closing the switch would cause the motor to turn. This is how battery-operated screwdrivers work. Second, voltages have a polarity associated with them, as shown by the voltmeter readings in Figures 2-4(b) and 2-5.

正弦波电压

Sinusoidal Wave Voltages

让我们考虑一下稍后会用到的一些术语。图 2-3(b) 中的电压波形称为正弦波,这是一个通用术语,可以指正弦波或余弦波,我们将在下一节中介绍这两种波形。正弦波在自然界中确实很丰富;以下是一些示例:

Let’s consider a bit of terminology that we’ll use later. The voltage waveform in Figure 2-3(b) is known as a sinusoidal wave, a generic term that can refer to either a sine or cosine wave, two waveforms we’ll describe in the next sections. Sinusoidal waves are truly abundant in nature; here are some examples:

• 河流或海洋中的波浪

• waves in a river or ocean

•声波

• sound waves

• AM 和 FM 广播电台辐射的电磁波

• electromagnetic waves radiated by AM and FM broadcast stations

• 地震波(地震)

• seismic waves (earthquakes)

• 夜空中的星光

• starlight in the night sky

事实上,现在您可能距离以正弦方式波动的电压不超过 10 英尺。我们指的是 120 伏交流电(交流电)壁式插座导体处的振荡电压。在欧洲,它将是一个 220 伏的交流壁式插座。

In fact, right now you’re probably no farther than 10 feet from a voltage that fluctuates in a sinusoidal manner. We’re referring to the oscillating voltage at the conductors of your 120 volt AC (alternating current) wall socket. In Europe, it would be a 220 volt AC wall socket.

图 2-3(b) 中的电压波形是一种称为正弦波的特定正弦波,正弦波几乎出现在数字信号处理的每个方面。因此,我们现在仔细研究正弦波。

The voltage waveform in Figure 2-3(b) is a specific kind of sinusoidal wave called a sine wave, and sine waves show up in almost every aspect of digital signal processing. As such, we now take a closer look at sine waves.

Sine Waves

让我们来做一下阿尔伯特·爱因斯坦最喜欢的消遣之一,一个思想实验。假设一个喜欢冒险的年轻小伙子决定爬到伦敦大本钟的巨大分针的末端,并围绕钟面骑行一小时,这将是一件有趣的事情。他可能首先想在分针水平并指向 9 位置的整点后 45 分钟爬出,如图 2-6(a) 所示。5 分钟后,在 10 位置,他将被提升到一半 (0.5) 到顶部(见图 2-6(b))。在 11 位置,他将大部分时间都接近顶部 (0.866),而在 12(小时顶部)位置,他将处于分针的最大高度。1

Let’s engage in one of Albert Einstein’s favorite pastimes, a thought experiment. Suppose an adventurous young lad decided it would be fun to climb out to the end of the huge minute hand of London’s Big Ben and ride it around the clock’s face for one hour. He might first want to climb out at 45 minutes past the hour when the minute hand is horizontal and pointing to the 9 position, as shown in Figure 2-6(a). Five minutes later at the 10 position, he would be lifted halfway (0.5) to the top (see Figure 2-6(b)). At the 11 position, he would be most of the way toward the top (0.866), and at the 12 (top of the hour) position, he would be at the minute hand’s maximum height.1

1. 对于伊丽莎白塔上的大本钟来说,这将接近离地面 200 英尺,伊丽莎白塔以其最大的钟而得名。

1. That would be close to 200 feet above ground level for Big Ben on the Elizabeth Tower, nicknamed for its largest bell.

Image

图 2-6骑大本钟的分针:(a) 起点;(b) 中途点;(c) 身高与一小时时间;(d) 身高与四个小时的时间。

Figure 2-6 Riding Big Ben’s minute hand: (a) starting point; (b) halfway point; (c) height versus one hour of time; (d) height versus four hours of time.

继续他的旅程,当分针再次水平指向 3 时,我们的冒险家将处于他原来的高度,而在最低高度 6 处,即小时底部。然后,他将在他开始的 9 号位置完成骑行。

Continuing his ride, our daredevil would be at his original height when the minute hand is horizontal again pointing to 3, and at the minimum height at 6, the bottom of the hour. He would then finish his ride at the 9 position where he started.

如果我们要勾勒出我们的年轻小伙子在他一小时的欢乐骑行中达到的相对身高,我们可以在图 2-6(c) 中绘制著名的正弦波曲线的单个周期。这显示了正弦波与圆周长周围点的垂直高度之间的重要基本关系。图 2-6(d) 显示了正弦波的四个周期。

If we were to sketch the relative height our young lad achieved during his hour of joy-riding, we would plot a single cycle of the well-known sine wave curve in Figure 2-6(c). This shows the important fundamental relationship between a sine wave and the vertical height of points around the perimeter of a circle. Figure 2-6(d) shows four cycles of a sine wave.

余弦波

继续我们的思想实验:假设我们的时钟骑手选择等待 15 分钟(一刻钟,四分之一周期),并从垂直 12 位置而不是水平 9 位置开始骑行。他将在离地面的最高点开始和结束他的骑行,如果我们随着时间的推移绘制他的相对身高,它看起来就像图 2-7(a) 中的曲线。这条曲线称为余弦波

To continue our thought experiment: suppose our clock rider chose to wait 15 minutes (a quarter of an hour, a quarter cycle) and start his ride at the vertical 12 position rather than the horizontal 9. He would start and end his ride at the highest point above the ground and, if we sketched his relative height as time passed, it would look like the curve in Figure 2-7(a). That curve is called a cosine wave.

Image

图 2-7从第 12 位开始骑大本钟的分针:(a) 高度与时间的关系;(b) 正弦波和余弦波之间的时间关系。

Figure 2-7 Riding Big Ben’s minute hand starting at the 12 position: (a) height versus time; (b) time relationship between a sine wave and a cosine wave.

正弦波是余弦波的延迟时间版本。工程师将这种关系称为“正弦和余弦之间四分之一周期的相移”,或者在我们的例子中,如图 2-7(b) 所示的四分之一小时。正弦波和余弦波都被称为正弦波。信不信由你,您刚刚学习了正弦和余弦的基础知识!

A sine wave is a delayed-in-time version of a cosine wave. Engineers call this relationship “a phase shift of one-quarter cycle between the sine and cosine,” or in our case, one-quarter hour as depicted in Figure 2-7(b). Both sine waves and cosine waves are known as sinusoidal waves. Believe it or not, you’ve just learned the basics of sines and cosines!

现在,我们将如何调整这些知识以适应工程领域。古人用圆圈而不是时钟来描述正弦和余弦。2 他们没有使用顺时针旋转的分针,而是使用了一条长度为 1 个单位的线,代表一个圆的半径,该圆围绕一个圆逆时针旋转 360 ,如图 2-8 所示。对我们来说,这条单位长度线由图中的粗体箭头表示。圆心的零表示 x 轴值为零且 y 轴值为零的点。

Now here’s how we adjust this knowledge to the world of engineering. The ancients used a circle rather than a clock to describe sines and cosines.2 Instead of a clockwise rotating minute hand, they used a line 1 unit in length, representing the radius of a circle that rotates counterclockwise through 360 degrees around a circle, as shown in the two-dimensional Figure 2-8. For us, this unit-length line is represented by the bold arrow in the figure. The zero in the center of the circle represents a point where the x-axis value is zero and the y-axis value is zero.

2. 古人中有巴比伦人、苏美尔人和希腊人——不是你们的作者。

2. Among the ancients are Babylonians, Sumerians, and Greeks—not your authors.

Image

图 2-8 (a) 正弦和余弦的工程基础;(b) 水平和垂直距离表示。

Figure 2-8 (a) Engineering basis for sines and cosines; (b) horizontal and vertical distance representations.

箭头从指向右侧 0 度开始,然后逆时针绕圆 360 度回到开始的位置。在一次箭头旋转过程中,箭头尖端在 x 轴上方或下方的垂直距离由正弦波曲线表示,如图 2-6(c) 所示。箭头尖端到 y 轴右侧或左侧的水平距离由图 2-7(a) 中的余弦波曲线表示。这些表示如图 2-8(b) 所示。

The arrow starts by pointing to the right side at 0 degrees and proceeds counterclockwise around the circle 360 degrees back to where it started. During one arrow rotation, the vertical distance of the arrow tip above or below the x-axis is represented by the sine wave curve in Figure 2-6(c). The horizontal distance of the arrow tip to the right or the left of the y-axis is represented by the cosine wave curve in Figure 2-7(a). Those representations are shown in Figure 2-8(b).

在这一点上,你可能会认为我们在这里花了太多时间来描述正弦波和余弦波。对此,我们说正弦波和余弦波渗透到模拟和数字信号处理的方方面面,花在理解正弦波和余弦波上的时间绝不会浪费时间。好,话虽如此,让我们再次探讨电压的话题。

At this point, you might think that we’ve spent too much time here describing sine and cosine waves. To that we say sine and cosine waves pervade every aspect of both analog and digital signal processing, and time spent understanding sine and cosine waves is never wasted time. OK, with that said, let’s explore the topic of voltages once more.

正弦和余弦电压

假设我们将正弦波电压施加到图 2-3(a) 所示的四通道示波器的第一个输入端口,并将余弦波电压施加到示波器的第二个输入端口。示波器的双迹线显示如图 2-9 所示。在那里,我们看到余弦波电压只是正弦波电压的时间延迟(正好是四分之一个周期)版本。事实证明,有许多信号处理应用需要从业者同时生成正弦波和余弦波信号。正弦波和余弦波被称为周期波,因为它们的波形会随着时间的推移周期性地重复。

Let’s suppose we applied a sine wave voltage to the first input port of the four-channel oscilloscope shown in Figure 2-3(a) and applied a cosine wave voltage to the scope’s second input port. The scope’s dual-trace display would appear as shown in Figure 2-9. There, we see that a cosine wave voltage is merely a delayed-in-time (by exactly one-fourth of a cycle) version of sine wave voltage. As it turns out, there are many signal processing applications that require the practitioner to generate both sine wave and cosine wave signals simultaneously. Sine and cosine waves are known as periodic waves because their waveforms periodically repeat themselves as time passes.

Image

图 2-9示波器显示显示正弦波电压和余弦波电压之间的时间关系。

Figure 2-9 Oscilloscope display showing the time relationship between a sine wave voltage and a cosine wave voltage.

其他有用的周期性模拟信号

Other Useful Periodic Analog Signals

所有正弦波电压都是周期性的,但并非所有周期性电压都是正弦电压。信号处理人员在各种应用以及测试目的中使用了许多专门的周期性模拟电压信号。

All sinusoidal wave voltages are periodic, but not all periodic voltages are sinusoidal. There are a number of specialized periodic analog voltage signals used by signal processing folk in various applications as well as for testing purposes.

图 2-10 显示了所谓的方波电压,它每半秒重复一次其周期;即每秒振荡 2 次。我们说那个方波的周期是 0.5 秒,这意味着它每 0.5 秒重复一次振荡。请注意,双电平电压如何在两个不同的电压电平之间非常快速地来回波动。如您所见,方波信号的形状不一定是方形的;图 2-10 中的电压更像矩形而不是正方形。然而,当你听到有人谈论方波时,他们实际上的意思是一个信号,它在两个电压电平之间切换,并在每个电平上花费 50% 的时间。(图 2-3(a) 中示波器上底部的两个电压波形是方波。

Figure 2-10 shows what is called a square wave voltage that repeats its cycle once every half second; that is, two oscillations/second. We say that the period of that square wave is 0.5 seconds, meaning that it repeats its oscillation once every 0.5 seconds. Notice how that bi-level voltage very quickly fluctuates back and forth between two distinct voltage levels. As you can see, a square wave signal is not necessarily square in its shape; the voltage in Figure 2-10 is more rectangular than square. Nevertheless, when you hear someone talk about a square wave, what they actually mean is a signal that toggles between its two voltage levels and spends 50% of its time at each level. (The bottom two voltage waveforms on the oscilloscope in Figure 2-3(a) are square waves.)

Image

图 2-10模拟方波。

Figure 2-10 Analog square wave.

现在,我们将图 2-10 称为模拟方波,因为它符合我们对模拟信号最重要的定义之一。也就是说,当我们在一张纸上绘制方波信号时,我们的笔或铅笔的尖端永远不会离开纸张表面。方波是连续的

For now, we’ll call Figure 2-10 an analog square wave because it meets one of our most important definitions of an analog signal. Namely, when we draw the square wave signal on a piece of paper, the tip of our pen or pencil never leaves the surface of the paper. The square wave is continuous.

在您的台式机和笔记本电脑内部,有一个称为时钟信号的方波电压。这个恒定周期的方波电压用于同步计算机中的各种电路操作。当您读到计算机的时钟频率为 500 兆赫兹 (Mhz) 时,这意味着计算机生成并使用每秒振荡 5 亿次的内部方波时钟电压。时钟频率越高,计算机的运行速度就越快。用技术术语来说,每秒 1 次振荡的频率称为 1 赫兹 (Hz)。我们将在下一章更详细地讨论频率的概念。

Inside your desktop and laptop computers, there is a square wave voltage called the clock signal. This constant-period square wave voltage is used to synchronize various circuit operations within your computer. When you read that a computer’s clock frequency is 500 megahertz (Mhz), this means the computer generates and uses an internal square wave clock voltage oscillating 500 million times per second. The higher the clock frequency, the faster will be a computer’s operating speed. In technical terms, a frequency of one oscillation per second is referred to as one hertz (Hz). We’ll discuss the notion of frequency in more detail in the next chapter.


顺便一提

By the Way

在 1970 年代后期,早期批量生产的 Atari 和 Apple 个人电脑 (PC) 的内部时钟频率约为 1 兆赫兹(1 MHz,100 万次振荡/秒)。在撰写本文时,很容易购买时钟频率为 4 GHz(4 GHz,40 亿次振荡/秒)的 PC,运行速度的惊人提升。如果自亨利·福特早期量产的 T 型车以来,汽车领域出现这样的速度增加,那么现在的汽车的最高时速将为 180,000 英里/小时(288,000 公里/小时)。这比波音 747 喷气式客机的巡航速度快 300 多倍!

In the late 1970s, the early, massed-produced Atari and Apple personal computers (PCs) had internal clock frequencies of roughly one megahertz (one MHz, one million oscillations/second). As of this writing, it’s easy to buy a PC with a clock frequency of 4 gigahertz (4 GHz, four billion oscillations/second), an amazing increase in operating speed. If such a speed increase occurred in the automotive field since Henry Ford’s early mass-produced Model T, current automobiles would have a top speed of 180,000 mph (288,000 km/h). That’s more than 300 times faster than the cruising speed of a Boeing 747 jet airliner!


您可能会不时听到信号处理工程师谈论三角波电压。这是一个周期性电压波形,如图 2-11 所示。很容易看出为什么该信号被称为三角电压。

Now and then, you may hear signal processing engineers speak of a triangular wave voltage. This is a periodic voltage waveform as shown in Figure 2-11. It’s easy to see why that signal is called a triangular voltage.

Image

图 2-11周期性三角波模拟信号。

Figure 2-11 Periodic triangular-wave analog signal.

我们将在下一章中再次遇到方波和三角波。现在我们已经对电压这个词的含义有些熟悉了,接下来我们要回到模拟信号这个话题。

We’ll encounter square and triangular waves again in the next chapter. Now that we’re somewhat comfortable with the meaning of the word voltage, we’ll return to the topic of analog signals.

人类语音模拟信号

A Human Speech Analog Signal

为了扩展我们对模拟信号的了解,让我们考虑图 2-12(a),它显示了当星际飞船企业号的 James T. Kirk 上尉说出“Mister Spock”这个词时,录音室麦克风的电压输出。该电压波形具有丰富的波动复杂性。显然,图 2-12(a) 中的波形并不是实际单词的声音。相反,波形是他们声音的电压模拟。如果我们放大这个电压并将其连接到扬声器的端子上,那么我们将听到“Mister Spock”字样的实际音频声音。在这种情况下,波动的电压会导致扬声器的锥体振荡进出,从而产生高气压和低气压的行波。我们的耳朵将这些气压波动转化为发送到我们大脑的电信号,我们体验到听到柯克上尉声音的感觉。

To expand our knowledge of analog signals, let’s consider Figure 2-12(a), which shows the voltage output of a studio microphone when Capt. James T. Kirk, of the starship Enterprise, speaks the words “Mister Spock.” That voltage waveform is rich in its fluctuating complexity. Obviously, the waveform in Figure 2-12(a) is not the sound of the actual words. Instead, the waveform is a voltage analogue of their sounds. If we amplified this voltage and connected it to the terminals of a loudspeaker, then we’d hear the actual audio sound of the words “Mister Spock.” In this scenario, the fluctuating voltage causes the loudspeaker’s cone to oscillate in and out, generating traveling waves of high and low air pressure. Our ears convert those air pressure fluctuations to an electrical signal sent to our brains, and we experience the sensation of hearing Capt. Kirk’s voice.

Image

图 2-12模拟音频语音信号:(a) “Mister Spock”;(b) “错误。”

Figure 2-12 Analog audio speech signal: (a) “Mister Spock”; (b) “Mis.”

我们可以通过放大单词 “Mister” 的第一个音节来进一步检查图 2-12(a) 中模拟电压的复杂模式。图 2-12(b) 显示了音节 “Mis” 的电压波形的详细信息。信号处理人员每天都要处理这样的电压波形。它们收集、检查、表征,有时还会修改这些类型的模拟信号。在后面的章节中,我们将了解可以对模拟信号执行的有用操作。

We can examine the complicated pattern of the analog voltage in Figure 2-12(a) further by zooming in on the first syllable of the word “Mister.” Figure 2-12(b) shows the details of the voltage waveform of just the syllable “Mis.” Signal processing people work with voltage waveforms like this every day. They collect, examine, characterize, and sometimes modify these sorts of analog signals. In later chapters, we’ll learn about the useful operations that can be performed on analog signals.


顺便一提

By the Way

音频工程师有时会将多个音频模拟信号组合在一起以创建新的音频信号。例如,在 1998 年的电影《哥斯拉》中,在野兽撞毁纽约市的场景中,建筑物倒塌的声音被添加到攻击直升机的声音中。用于描述添加多个音频信号的过程的术语称为 Mix Down,或简称为 Plain Mixing。(不,混音工程师不被称为调酒师。这个头衔是为另一个职业保留的。

Audio engineers sometimes combine multiple audio analog signals to create a new audio signal. For example, in the 1998 movie Godzilla, in the scene where the beast is crashing its way through New York City, the sound of collapsing buildings was added to the sound of attacking helicopters. The term used to describe the process of adding multiple audio signals is called mix down, or just plain mixing. (No, audio mixing engineers are not called mixologists. That title is reserved for another profession.)


您应该记住什么

What You Should Remember

哇!在本章中,我们介绍了许多技术材料。如果您已经阅读了整章,请拍拍自己的后背,因为您已经学到了大量的模拟信号处理理论。

Wow! We covered a lot of technical material in this chapter. If you’ve plowed your way through this entire chapter, pat yourself on the back because you’ve learned an astounding amount of analog signal processing theory.

您可能会认为我们在这一章中对模拟信号的主题进行了过多的阐述,尤其是对于一本关于数字信号处理的书。别担心,我们不会浪费时间、纸张或墨水。我们学到的关于模拟信号的所有概念都将帮助我们理解数字信号。

You may think we belabored the subject of analog signals a bit too much in this chapter, especially for a book about digital signal processing. Don’t worry, we’re not wasting time, paper, or ink. All of the concepts we learned about analog signals will help us understand digital signals.

本章中应记住的概念是:

The concepts you should remember from this chapter are:

• 模拟信号是携带信息的物理量,其值会随着时间的推移而变化。

• Analog signals are information-carrying physical quantities that vary in value as time passes.

• 速度、振动、温度、声压和光强度等物理量可以转换为电缆上的电压,从而可以在示波器的屏幕上查看它们。

• Physical quantities such as speed, vibration, temperature, sound pressure, and light intensity can be converted to voltages on a cable, allowing them to be viewed on the screen of an oscilloscope.

• 信号处理工程师主要处理时变电压形式的模拟信号。

• Signal processing engineers work primarily with analog signals in the form of time-varying voltages.

• 周期性变化的电压,如正弦波和余弦波电压,在信号处理领域非常常见。

• Periodically varying voltages, like sine and cosine wave voltages, are very common in the world of signal processing.

• 周期性电压每单位时间的重复率称为频率。

• The repetition rate, per unit time, of a periodic voltage is called frequency.

• 频率通常以赫兹 (Hz) 为单位进行测量。1 Hz 等于每秒一个周期。

• Frequency is most commonly measured in units of hertz (Hz). One Hz is equal to one cycle per second.

3. 模拟信号的频率和频谱

3. Frequency and the Spectra of Analog Signals

在上一章中,我们研究了模拟信号值如何随时间变化(波动)的图形图。这些图对于理解任何给定模拟信号的性质至关重要。但是,还有另一种非常有用且具有启发性的方法来描述模拟信号。这种替代描述称为模拟信号的频谱。虽然您在日常生活中不经常遇到频谱的概念,但信号处理人员每天都在研究和分析信号频谱。当工程师检查(分析)模拟信号时,了解信号的频谱与了解医生检查的患者的温度、血压和心率一样重要。

In the last chapter, we looked at graphical plots of how analog signals vary in value (fluctuate) as time passes. Those plots are crucial in understanding the nature of any given analog signal. However, there’s another very useful, and revealing, way to describe an analog signal. That alternate description is called the spectrum of an analog signal. Although you don’t often encounter the concept of spectra in your everyday life, signal processing people study and analyze signal spectra every day. When engineers examine (analyze) an analog signal, knowing a signal’s spectrum is as important as knowing the temperature, blood pressure, and heart rate of a patient being examined by a medical doctor.

因此,在我们对信号处理的研究中,了解信号的频谱是什么以及为什么这些信息有用是很重要的。这就是本章的目标。但在我们讨论模拟信号的频谱是什么之前,我们必须简要地回顾一下频率的概念。

So, in our study of signal processing, it’s important that we learn what a signal’s spectrum is and why such information is useful. That’s the goal of this chapter. But before we discuss just what the spectrum of an analog signal is, we must, by necessity, briefly return to and focus on the notion of frequency.

频率

Frequency

在上一章中,我们介绍了术语 frequency,我们现在需要以更正式的方式定义这个术语。

In the last chapter, we introduced the term frequency, a term that we now need to define in a more formal way.

频率是周期性(重复)事件的特征。对我们来说,频率是衡量某些重复事件在一段时间内发生的频率的指标。也就是说,频率是每单位时间的周期(重复)数。例如,当汽车仪表板上转速表的指针指向数字 2 时,这意味着汽车的发动机以每分钟 2,000 转 (RPM) 的重复频率旋转。每转都是一次重复,频率每分钟重复 2,000 次。

Frequency is a characteristic of periodic (repetitive) events. For us, frequency is the measure of how often some repetitive event occurs over some period of time. That is, frequency is a number of cycles (repetitions) per some unit of time. For example, when the needle of the tachometer on an automobile dashboard points to the number 2, that means the automobile’s engine is rotating at a repetition rate of 2,000 revolutions per minute (RPM). Each revolution is a repetition, making the frequency 2,000 repetitions per minute.

每秒周期数

Cycles per Second

在上一章中,我们讨论了 ping 音叉的想法以及音叉的振荡声波到达麦克风。如果麦克风的输出电缆连接到示波器的输入端口,则示波器的显示屏将显示正弦电压信号,如图 3-1 所示。例如,音叉可用于定义钢琴键盘上 A 键的标准音高(中间 C 上方的 A 键)。这个标准间距称为“A440”。因此,在图 3-1 中,这些正弦模拟波振荡的频率为 440 赫兹(每秒 440 次振荡,每秒 440 个周期)。为简洁起见,工程师将 440 赫兹写为 440 赫兹。

In the last chapter, we discussed the idea of pinging a tuning fork and the fork’s oscillating sound wave arriving at a microphone. If the microphone’s output cable were connected to the input port of an oscilloscope, then the scope’s display would show the sinusoidal voltage signal depicted in Figure 3-1. For example, a tuning fork can be used to define the standard pitch of the A key on a piano keyboard (the A key above middle C). This standard pitch is called “A440.” Thus, in Figure 3-1 the frequency of those sinusoidal analog wave oscillations is 440 hertz (440 oscillations per second, 440 cycles per second). For brevity, engineers write 440 hertz as 440 Hz.

Image

图 3-1麦克风输出 音叉声音的模拟电压。

Figure 3-1 Microphone output analog voltage of a tuning-fork sound.

您可能熟悉的另一个频率是您家中墙壁插座上的 AC(交流电)电源的频率。根据您的地理位置,交流电力线频率将为 50 Hz 或 60 Hz。例如,在美国,如果您查看厨房柜台上任何电器的底板,您会看到“60 Hz”字符。

Another frequency you’re probably familiar with is the frequency of the AC (alternating current) electrical power at a wall socket in your home. Depending on your geographical location, the AC power line frequency will be either 50 Hz or 60 Hz. For example, in the United States, if you look at the bottom panel of any appliance on your kitchen counter, you’ll see the characters “60 Hz.”

表 3.1 中给出了电力线频率的简短列表。交流电源线电压是正弦形状的,这意味着导体相对于中性导体的电压从正向负波动,然后又回到正向波动,如图 3-1 中的电压波形一样。

A short list of power line frequencies is given in Table 3.1. AC power line voltages are sinusoidal in shape, meaning that the voltage of the hot conductor relative to the neutral conductor fluctuates from positive to negative, and then back to positive, just as does the voltage waveform in Figure 3-1.

Image

表 3.1交流电源线频率

Table 3.1 AC Power Line Frequencies


顺便一提

By the Way

在电力的早期,频率的测量单位是每秒周期数(Cycles/second)。这就是为什么在旧收音机的调谐拨盘上印有“千周/秒”和“兆周/秒”这两个词来表示频率的原因。在 1960 年代,欧洲和北美科学界采用赫兹 (Hz) 一词作为频率的测量单位,以纪念德国物理学家海因里希·赫兹 (Heinrich Hertz),他于 1887 年首次展示了无线电波的发射和接收。

In the early days of electricity, the unit of measure for frequency was cycles per second (cycles/second). That’s why the words “kilocycles/second” and “megacycles/second” are printed on the tuning dials of old radios to indicate frequency. In the 1960s, the European and North American scientific communities adopted the word hertz(Hz) as the unit of measure for frequency in honor of the German physicist, Heinrich Hertz, who first demonstrated radio wave transmission and reception in 1887.

单音节单词 hertz 是一个不错的选择,因为它很容易说,而且在英语中听起来是复数。我们很幸运,赫兹的姓氏与阿诺德·施瓦辛格的姓氏完全不同。

The single-syllable word hertz was a good choice because it’s easy to say and it sounds plural in English. We’re fortunate that Hertz’s last name was nothing like Arnold Schwarzenegger’s.


信号处理工程师处理的信号覆盖了惊人的频率范围。音频工程师处理 20 Hz 至 20 kHz(20 kHz,20,000 Hz)频率范围内的模拟信号。无线电通信工程师处理频率范围从千赫兹到数千兆赫兹的模拟无线电波。一些手机以 900 兆赫兹的频率运行。典型微波炉内部的辐射频率约为 2.5 GHz(2,500 兆赫)。天文学家用太赫兹(万亿赫兹)测量的频率来监测模拟恒星辐射。表 3.2 给出了语言和符号,图 3-2 显示了现代技术中遇到的各种频率的粗略图形描述。

Signal processing engineers work with signals that cover an astounding range of frequencies. Audio engineers process analog signals in the frequency range of 20 Hz to 20 kilohertz (20 kHz, 20,000 Hz). Radio communications engineers deal with analog radio waves with frequencies in the range of kilohertz up to thousands of megahertz. Some cell phones operate at 900 megahertz. The frequency of the radiation inside the typical microwave oven is roughly 2.5 gigahertz (2,500 megahertz). Astronomers monitor analog stellar radiation with frequencies measured in terahertz (trillions of hertz). Table 3.2 gives the language and notation, and Figure 3-2 presents a crude graphical depiction, of various frequencies encountered in modern technology.

Image

表 3.2频率命名法

Table 3.2 Frequency Nomenclature

Image

图 3-2现代技术中遇到的频率范围。

Figure 3-2 Range of frequencies encountered in modern technology.

如果您以前没有见过,表 3.2 中间列中的符号称为科学记数法,这是工程师和科学家编写非常大和非常小的数字的一种方便而精确的方法。附录 A 中提供了对这种写入大数的方法的回顾。

In case you haven’t seen it before, the notation in the center column of Table 3.2 is called scientific notation, a convenient and precise way for engineers and scientists to write very large and very small numbers. A review of that method for writing large numbers is provided in Appendix A.

顺便说一句,以 kHz 为单位的小写 “k” 不是印刷错误。几十年来,千赫兹一直缩写为 kHz,而兆赫兹则缩写为 MHz,大写“M”。事情就是这样。

Incidentally, the lowercase “k” in kHz is not a typographical error. For many decades, kilohertz has been abbreviated as kHz and megahertz has been abbreviated MHz with the uppercase “M.” That’s just the way it is.

每秒弧度数

Radians per Second

偶尔,您会听到工程师以每秒弧度数为单位来引用正弦波或余弦波的频率。解释为什么人们有时会使用这样的术语很简单。

Occasionally you’ll hear an engineer refer to a sine wave’s or a cosine wave’s frequency in terms of radians per second. It’s straightforward to explain why people sometimes use such terminology.

也许您还记得几何学中圆的周长(周长)是其直径的 π (pi) 倍。1 由于直径是半径的两倍,圆的周长也可以表示为半径长度的 2π 倍。绕一圈需要 360 度,如图 3-3(a) 所示。同样,绕圆一圈需要 2π 弧度,有时缩写为 2π。所以 360 度(一个周期)等于 2π 弧度。因此,弧度是等于 360°/2π 的角度,大约为 57.3°,如图 3-3(b) 所示。

Maybe you remember from geometry that the length of the circumference (perimeter) of a circle is π (pi) times its diameter.1 Since the diameter is twice the radius, the circumference of a circle can also be expressed as 2π times the radius length. To travel once around a circle takes 360 degrees, as shown in Figure 3-3(a). Likewise, to go once around the circle takes 2π radians, sometimes abbreviated as just 2π. So 360 degrees (one cycle) is equal to 2π radians. Therefore, a radian is an angle equal to 360°/2π, roughly 57.3°, as shown in Figure 3-3(b).

1. π = 3.14159 . . .是我们宇宙中的基本常数之一。它的十进制数字延伸到小数点右侧的无穷大。但对我们来说,我们只能说 π = 3.14。

1. π = 3.14159 . . . is one of the fundamental constants in our universe. Its decimal digits extend to infinity to the right of its decimal point. But for us, we’ll just say that π = 3.14.

Image

图 3-3圆角:(a) 360°;(b) 2π 弧度。

Figure 3-3 Angles in a circle: (a) 360°; (b) 2π radian.

同样,从几何学的角度来看,我们认为圆包含 360 度,但在他们的数学方程式中,工程师将圆视为包含 2π 弧度要方便得多。无论如何,如果工程师说“正弦波的频率是 6280 弧度/秒”,那就是 6280/2π = 1,000 Hz(每秒周期数)的极客代言。

Again, from geometry we think of a circle as containing 360 degrees, but in their mathematical equations it’s much more convenient for engineers to think of a circle as containing 2π radians. In any case, if an engineer says a “sine wave’s frequency is 6280 radians/second,” that’s Geek Speak for 6280/2π = 1,000 Hz (cycles per second).

频谱的概念

The Concept of Spectrum

到目前为止,在本章和第 2 章中,我们已经研究了几种不同波动模拟信号的图形表示。我们查看了二维图形,其中图形的纵轴表示信号的瞬时振幅(能量),横轴表示时间,如图 3-1 所示。这种图形显示信号的电压幅度水平如何随时间变化,称为时域图。时域图的横轴始终以时间单位为单位。表征模拟信号的另一种强大且重要的方法是描述其频率内容。信号的频率内容称为信号的频谱

So far in this chapter and in Chapter 2, we’ve looked at graphical representations of a few different fluctuating analog signals. We viewed two-dimensional graphs where the vertical axis of a graph represents a signal’s instantaneous amplitude (energy) and the horizontal axis represents time, as we saw in Figure 3-1. Such graphs, which show how a signal’s voltage amplitude level changes as time passes, are called time-domain plots. The horizontal axis of time-domain plots is always in units of time. Another powerful, and important, way to characterize analog signals is to describe their frequency content. The frequency content of a signal is called the signal’s spectrum.

对我们来说,信号的频谱是指构成信号的不同频率的正弦波的组合。例如,您已经对频谱的概念有所了解。如果将一束白光照射在玻璃棱镜的一侧,则多色光会从棱镜的另一侧射出,如图 3-4 中的粗略图所示。这是因为当光从一种介质(空气)移动到另一种介质(玻璃)时,它会改变方向。这种方向变化称为折射,折射量取决于光的频率。因此,可以使用棱镜将光分解成其构成光谱颜色。图 3-4 向我们展示了白光实际上是多种颜色的光的组合。

For us, the spectrum of a signal means the combination of sinusoidal waves of different frequencies that make up a signal. For example, you’re already somewhat familiar with the notion of a spectrum. If you shine a beam of white light on one side of a glass prism, multicolored light exits the opposite side of the prism as shown by the crude diagram in Figure 3-4. That’s because light changes direction when it moves from one medium (air) to another medium (glass). That direction change is called refraction, and the amount of refraction depends on the frequency of the light. So a prism can be used to break light up into its constituent spectral colors. Figure 3-4 shows us that white light is, in fact, a combination of multiple colors of light.

Image

图 3-4将白光分解为其组成颜色(光谱)。

Figure 3-4 Breaking white light up into its constituent colors (spectrum).


顺便一提

By the Way

当您在天空中看到彩虹时,大气中的水滴表现为单独的棱镜。彩虹是由于光线在进入水滴时被折射,然后从水滴的背面反射,并在离开水滴时再次折射而引起的。如果你有幸看到过双彩虹,那么第二道彩虹是由水滴内部反射两次的光引起的。双彩虹的巧妙之处在于,次色虹中的颜色序列与主彩虹中的颜色顺序相反。

When you see a rainbow in the sky, water droplets in the atmosphere are behaving as individual prisms. The rainbow is caused by light being refracted while entering a droplet of water, then reflected from the back side of the droplet, and refracted again when leaving the droplet. If you’re lucky enough to ever see a double rainbow, the second rainbow is caused by light reflecting twice inside water droplets. The neat thing about double rainbows is that the sequence of colors in the secondary rainbow is reversed from the order of the colors in the primary rainbow.


模拟信号频谱

Analog Signal Spectra

考虑到频谱的概念,工程师实际上可以使用频谱分析仪显示和测量模拟信号的频谱,如图 3-5 所示。频谱分析仪显示构成模拟信号的不同频率的正弦波的组合。让我们看一下模拟电压信号频谱的几个示例。

With this concept of spectrum in mind, engineers can actually display and measure an analog signal’s spectrum using a spectrum analyzer like that shown in Figure 3-5. A spectrum analyzer displays the combination of sinusoidal waves of different frequencies that make up an analog signal. Let’s look at a few examples of the spectra of analog voltage signals.

Image

图 3-5商用模拟频谱分析仪。(由 Anritsu Inc. 提供)

Figure 3-5 Commercial analog spectrum analyzer. (Courtesy of Anritsu Inc.)

假设麦克风的输出电压为 100 Hz 正弦波,如图 3-6(a) 所示。将该电压连接到频谱分析仪的输入端口将导致分析仪的频域显示,如图 3-6(b) 所示。频域图的横轴始终以频率单位表示,通常为 Hz。分析仪的前面板控件经过设置,分析仪频率显示的开始频率和停止频率分别为 90 Hz 和 110 Hz。

Assume a microphone’s output voltage is a 100 Hz sine wave as shown in Figure 3-6(a). Connecting that voltage to the input port of a spectrum analyzer would result in the analyzer’s frequency-domain display, which is shown in Figure 3-6(b). The horizontal axis of frequency domain plots is always in units of frequency, typically Hz. The front panel controls of the analyzer are set so that the start frequency and the stop frequency of the analyzer’s frequency display are 90 Hz and 110 Hz respectively.

Image

图 3-6100 Hz 模拟正弦波:(a) 时间波形;(b) 频谱分析仪频谱显示。

Figure 3-6 A 100 Hz analog sine wave: (a) time waveform; (b) spectrum analyzer spectral display.

频谱分析仪包含一个调谐频率能量检测器,该检测器最初调谐到 90 Hz 的起始频率。在该频率下,分析仪在其输入端未检测到以 90 Hz 振荡的能量,因此在其显示屏上的 90 Hz 水平位置,分析仪不显示频谱能量。然后,调谐频率检测器调谐到 91 Hz,在那里它没有检测到输入 91 Hz 频谱能量,并且再次在其显示屏上的 91 Hz 水平位置,分析仪没有显示频谱能量。当调谐检测器从 92 Hz 调谐到 99 Hz 时,也会发生同样的情况。然后,当调谐到 100 Hz 时,能量检测器指示以 100 Hz(100 次循环/秒)振荡的高水平输入能量。该事件导致分析器在图 3-6(b) 中以 100 Hz 的频率值显示高电平垂直尖峰。

The spectrum analyzer contains a tuned-frequency energy detector that is initially tuned to the start frequency of 90 Hz. At that frequency, the analyzer detects no energy at its input that oscillates at 90 Hz, so at the horizontal position of 90 Hz on its display screen, the analyzer shows no spectral energy. The tuned-frequency detector is then tuned to 91 Hz where it detects no input 91 Hz spectral energy and, again at the horizontal position of 91 Hz on its display screen, the analyzer shows no spectral energy. The same thing happens as the tuned detector is tuned from 92 Hz up to 99 Hz. Then, when tuned to 100 Hz, the energy detector indicates a high level of input energy that oscillates at 100 Hz (100 cycles/second). That event causes the analyzer to display the high-level vertical spike at a frequency value of 100 Hz in Figure 3-6(b).

分析仪的调谐频率检测器随后依次从 101 Hz 调谐到 110 Hz 的停止频率,在每种情况下,都没有检测到频谱能量,分析仪的显示屏在 101 至 110 Hz 的频率范围内没有显示输入频谱能量,如图 3-6(b) 所示。图 3-6(b) 中唯一的垂直尖峰告诉我们,频谱分析仪输入端的电压包含一个以 100 Hz 振荡的波形,正如我们通过参考图 3-6(a) 所预期的那样。

The analyzer’s tuned-frequency detector is subsequently tuned, in turn, from 101 Hz to the stop frequency of 110 Hz where, in each case, no spectral energy is detected and the analyzer’s display shows no input spectral energy in the frequency range of 101 to 110 Hz in Figure 3-6(b). That lone vertical spike in Figure 3-6(b) tells us that the voltage at the input of the spectrum analyzer contains a waveform oscillating at 100 Hz as we would expect by referring back to Figure 3-6(a).

假设工程师想要实际验证麦克风输出正弦波电压的频率。有两种方法可以做到这一点。在第一种方法中,工程师可以使用前面提到的示波器查看电压的时间波形,以查看图 3-6(a) 中的显示。将一次振荡的持续时间测量为百分之一秒,工程师就知道在一秒的时间间隔内发生了 100 次振荡。因此,正弦波的频率为 100 Hz(100 个周期/秒)。

Let’s say an engineer wants to actually verify the frequency of the microphone’s output sine wave voltage. There are two ways to do so. In the first method, the engineer could look at the voltage’s time waveform using an oscilloscope, mentioned earlier, to see the display in Figure 3-6(a). Measuring the time duration of one oscillation to be one hundredth of a second, the engineer then knows that 100 oscillations occur over a time interval of one second. Thus, the sine wave’s frequency is 100 Hz (100 cycles/second).

The second frequency measurement method is simpler. The engineer merely connects the sine wave voltage to the input of a spectrum analyzer, views the spectral display in Figure 3-6(b) to see the frequency location of the high-level spectral amplitude spike, and quickly determines that the sine wave’s frequency is indeed 100 Hz.

The second frequency measurement method is simpler. The engineer merely connects the sine wave voltage to the input of a spectrum analyzer, views the spectral display in Figure 3-6(b) to see the frequency location of the high-level spectral amplitude spike, and quickly determines that the sine wave’s frequency is indeed 100 Hz.

关键是,工程师有时会使用示波器查看模拟信号随时间变化的幅度波形,有时他们会使用频谱分析仪查看模拟信号的频谱(频率)含量,而与时间无关。频谱分析仪是功能非常强大的测试仪器,因为它们的开始和停止频率可以设置为从几十 Hz 到几 GHz 的任何值。示波器和频谱分析仪对工程师的用处就像锤子和锯子对木匠的用处一样。

The point is that engineers sometimes look at analog signals’ amplitude waveforms over time using an oscilloscope, and sometimes they look at the spectral (frequency) content of analog signals, irrespective of time, using a spectrum analyzer. Spectrum analyzers are very powerful test instruments because their start and stop frequencies can be set to any values from tens of Hz to several GHz. An oscilloscope and a spectrum analyzer are as useful to engineers as a hammer and a saw are useful to carpenters.

使用频谱分析仪,我们可以在麦克风附近对具有未知调谐频率的音叉进行 ping 操作(振动),其输出电缆连接到频谱分析仪的输入端。然后,我们可以通过观察分析仪显示屏上窄频谱幅度尖峰的水平频率位置来确定音叉的调谐频率。很整洁,是吧?

With a spectrum analyzer, we could ping (vibrate) a tuning fork that has a tuned frequency unknown to us, near a microphone with its output cable connected to the input of a spectrum analyzer. Then, we could determine the tuned frequency of the tuning fork by observing the horizontal frequency location of the narrow spectral amplitude spike on the analyzer’s display. Neat, huh?

复合信号频谱示例

A Composite-Signal Spectral Example

为了加强我们对信号频谱的理解,请考虑图 3-7(a) 中虚线曲线表示的高振幅 100 Hz 正弦波。该图还有一个较低振幅的 200 Hz 正弦波,由虚线曲线显示。(请注意,对于 100 Hz 正弦波的每次完整振荡,200 Hz 正弦波如何振荡两次。

To strengthen our understanding of signal spectra, consider the high-amplitude 100 Hz sine wave represented by the dashed-line curve in Figure 3-7(a). The figure also has a lower-amplitude 200 Hz sine wave shown by the dotted-line curve. (Notice how the 200 Hz sine wave oscillates twice for each complete oscillation of the 100 Hz sine wave.)

Image

图 3-7100 Hz 正弦波和 200 Hz 正弦波:(a) 时间波形;(b) 100 Hz 波的频谱;(c) 200 Hz 波的频谱。

Figure 3-7 A 100 Hz sine wave and a 200 Hz sine wave: (a) time waveforms; (b) spectrum of the 100 Hz wave; (c) spectrum of the 200 Hz wave.

100 Hz 和 200 Hz 正弦波的频谱分别显示在图 3-7(b)3-7(c) 中。由于图 3-7(a) 中 100 Hz 波的振幅大于 200 Hz 波的振幅,因此图 3-7(b) 的光谱能量尖峰高度大于图 3-7(c) 中的光谱能量尖峰高度。

The spectra of the 100 Hz and 200 Hz sine waves are shown in Figures 3-7(b) and 3-7(c), respectively. Because the amplitude of the 100 Hz wave is greater than the amplitude of the 200 Hz wave in Figure 3-7(a), the height of the spectral energy spike of the Figure 3-7(b) is greater than the height of the spectral energy spike in Figure 3-7(c).

如果我们加上 100 Hz 正弦波和 200 Hz 正弦波,结果将是复合 Sum 波形,如图 3-7(a) 中的实线曲线所示。请注意,在任何时刻,实线 Sum 波形都是该时刻虚线波和虚线波的总和。例如,在 1.25 分之一秒的时刻,虚线 200 Hz 曲线等于零,因此 Sum 曲线等于 100 Hz 曲线。在那个时刻,Sum 波等于 100 Hz 波加零。

If we added the 100 Hz sine wave and the 200 Hz sine wave, the result would be the composite Sum waveform shown as the solid-line curve in Figure 3-7(a). Notice that at any instant in time the solid-line Sum waveform is the sum of the dashed-line and dotted-line waves at that instant in time. For example, at the time instant of 1.25 hundredths of a second, the dotted 200 Hz curve equals zero, so the Sum curve is equal to the 100 Hz curve. At that instant in time, the Sum wave equals the 100 Hz wave plus zero.

图 1-17(a) 中复合和波的频谱如图 3-8 所示。图 3-8 中的光谱是图 3-7(b)图 3-7(c) 光谱之和。从图 3-8 中,我们了解到模拟信号最重要的特性之一:

The spectrum of the composite Sum wave in Figure 1-17(a) is shown in Figure 3-8. The spectrum in Figure 3-8 is the sum of the Figure 3-7(b) and Figure 3-7(c) spectra. From Figure 3-8 we learn one of the most important properties of analog signals:

Image

图 3-8复合 Sum 波形的频谱。

Figure 3-8 The spectrum of the composite Sum waveform.

两个模拟时间波之和的频谱等于波的单个频谱之和。

The spectrum of the sum of two analog time waves is equal to the sum of the waves’ individual spectra.

谐波

Harmonics

我们现在介绍一个关于模拟信号频谱的重要主题。这个主题是谐波,即时间信号中不需要的频谱分量,会导致时间信号的形状意外失真。我们首先参考图 3-9(a) 中的时域曲线来讨论谐波。在该图中,我们看到一个由实线曲线表示的高振幅 2 Hz 正弦波。该图还显示了分别由虚线和虚线曲线表示的较低振幅 6 Hz 和 10 Hz 正弦波。

There’s an important topic we now introduce with regard to the spectrum of analog signals. That topic is harmonics, the undesirable spectral components in a time signal that cause an inadvertent distortion of the shape of the time signal. We start our discussion of harmonics by referring to the time-domain curves in Figure 3-9(a). In that figure, we see a high-amplitude 2 Hz sine wave represented by the solid-line curve. The figure also shows lower-amplitude 6 Hz and 10 Hz sine waves represented by the dashed- and dotted-line curves, respectively.

Image

图 3-92 Hz 模拟方波信号:(a) 基波 2 Hz 正弦波及其前两个奇次谐波;(b) 基波正弦波加上它的前两个奇次谐波。

Figure 3-9 A 2 Hz analog square wave signal: (a) fundamental 2 Hz sine wave and its first two odd harmonics; (b) fundamental sine wave plus its first two odd harmonics.

如果我们将这三个图 3-9(a) 正弦曲线相加,则和就是图 3-9(b) 所示的波形。如果你能原谅这个老套的类比,我们可以说,如果你加上 1/4 杯 2 Hz 正弦波,加上 4 茶匙 6 Hz 正弦波,再加上 2.5 茶匙 10 Hz 正弦波,组合就是图 3-9(b) 中的波形。在那里,我们看到 Sum 波形看起来很像方波。6 Hz 和 10 Hz 正弦波称为“2 Hz 正弦波的奇次谐波”。这是因为 6 和 10 是 2 的整数倍;也就是说,6 = 3 × 2 和 10 = 5 × 2。数字 3 和 5 都是奇数,都是整数(整数)。我们可以自由地将图 3-9(b) 波形称为“2 Hz 方波”,因为它在 1 秒的时间间隔内重复两次。

If we add those three Figure 3-9(a) sinusoids together the sum is the waveform shown in Figure 3-9(b). If you’ll forgive the corny analogy, we can say that if you add 1/4 cup of a 2 Hz sine wave, plus 4 teaspoons of a 6 Hz sine wave, plus 2.5 teaspoons of a 10 Hz sine wave, the combination would be the waveform in Figure 3-9(b). There, we see the Sum waveform looks much like a square wave. The 6 Hz and 10 Hz sine waves are called the “odd harmonics of the 2 Hz sine wave.” That’s because 6 and 10 are integer multiples of 2; that is, 6 = 3 × 2 and 10 = 5 × 2. The numbers 3 and 5, both of which are odd numbers, are integers (whole numbers). We’re free to call the Figure 3-9(b) waveform a “2 Hz square wave” because it repeats itself twice in the time interval of one second.

此外,将图 3-10(a) 所示的 14 Hz (7 × 2) 和 18 Hz (9 × 2) 谐波的低振幅电平与图 3-9(b) 中的正弦波和相加,会产生如图 3-10(b) 所示的更像方波的方波。

In addition, adding the low-amplitude levels of 14 Hz (7 × 2) and 18 Hz (9 × 2) harmonic sine waves, shown in Figure 3-10(a), to the sum of sine waves in Figure 3-9(b) results in the even more square-like square wave we see in Figure 3-10(b).

Image

图 3-102 Hz 方波信号:(a) 基波 14 Hz 和 18 Hz 正弦波;(b) 基波 2 Hz 正弦波加上其前四个奇次谐波。

Figure 3-10 A 2 Hz square wave signal: (a) fundamental 14 Hz and 18 Hz sine waves; (b) fundamental 2 Hz sine wave plus its first four odd harmonics.

你可以看到这里发生了什么。我们添加到 2 Hz 正弦波的奇次谐波越多,求和波形就越接近 2 Hz 方波。这就是为什么我们可以说方波由一个基频正弦波加上该正弦波的奇次谐波组成或组成。从 2 Hz 正弦波开始并没有什么神圣之处。我们也可以在 15 kHz、25 kHz、35 kHz 和 45 kHz 的奇次谐波正弦波中加入一个 5 kHz (5,000 Hz) 的正弦波,并获得图 3-10(b) 中的方波,该波形在一秒钟内重复 5,000 次。

You can see what’s happening here. The more of its odd harmonics we add to a 2 Hz sine wave, the closer the summation waveform looks like a 2 Hz square wave. And that’s why we can say that a square wave is made up of, or comprises, a fundamental frequency sine wave plus that sine wave’s odd harmonics. There’s nothing sacred about starting with a 2 Hz sine wave here. We could just as well add a 5 kHz (5,000 Hz) sine wave to its odd harmonic sine waves of 15 kHz, 25 kHz, 35 kHz, and 45 kHz and obtain the square waveform in Figure 3-10(b) that repeats itself 5,000 times in one second.

图 3-10(b) 波形的频谱如图 3-11 所示。图 3-10 中的 2 Hz 频谱分量称为“基频”,因为图 3-10(b) 波形的重复频率为每秒两次重复(两个周期/秒)。

The spectrum of the Figure 3-10(b) waveform is shown in Figure 3-11. The 2 Hz spectral component in Figure 3-10 is called the “fundamental frequency” because the Figure 3-10(b) waveform’s repetition rate is two repetitions per second (two cycles/second).

Image

图 3-112 Hz 模拟方波的频谱显示。

Figure 3-11 Spectral display of a 2 Hz analog square wave.

您的作者意识到,如图 3-11 这样的光谱图可能是新的,并且对许多读者来说有点令人费解。信号处理工程师对该图的解释如下:图 3-11 简单地告诉我们,如图 3-10(b) 所示的时间波形包含一些给定的 2 Hz 正弦波振幅,加上一个较低振幅的 6 Hz 正弦波,以及较低振幅的 10 Hz、14 Hz 和 18 Hz 正弦波。

Your authors realize that spectral plots like Figure 3-11 may be new and a bit puzzling to many readers. Signal processing engineers interpret that figure as follows: Figure 3-11 simply tells us that a time waveform, shown in Figure 3-10(b), contains some given amplitude of a 2 Hz sine wave, plus a lower amplitude 6 Hz sine wave, plus lower-amplitude 10 Hz, 14 Hz, and 18 Hz sine waves.

为了说明方波确实包含奇次谐波,假设我们构建了一个音频检测系统,其中包含一个精心设计的麦克风,用于检测是否存在 18 Hz 正弦波音频音调。当检测到 18 Hz 音频音调时,系统会亮起红色警告灯。现在,如果我们将图 3-10(b) 所示的 2 Hz 方波电压连接到扬声器的端子,18 Hz 检测系统的警告灯会突然亮起。音频音调检测系统将识别 2 Hz 音频方波的 18 Hz 谐波分量,如图 3-11 所示。单频正弦波电压不包含谐波,但方波电压肯定包含谐波。

To illustrate that a square wave really does contain odd harmonics, let’s say we built an audio detection system, containing a microphone carefully designed to detect the presence of an 18 Hz sine wave audio tone. When an 18 Hz audio tone is detected, the system turns on a red warning light. Now, if we connected the 2 Hz square wave voltage shown in Figure 3-10(b) to the terminals of a loudspeaker, the 18 Hz detection system’s warning light would suddenly light up. The audio tone detection system would identify the 2 Hz audio square wave’s 18 Hz harmonic component that we showed in Figure 3-11. Single-frequency sine wave voltages contain no harmonics but square wave voltages certainly do.

这种谐波讨论的一个结果是,我们学习了所有信号处理中最重要的原理之一。那是:

One consequence of this harmonics discussion is that we learn one of the most important principles in all of signal processing. That is:

具有非常突然(突然)幅度变化的时间信号(如方波)比具有更平缓(平滑)幅度变化的单频正弦信号包含更高频率的频谱内容。

A time signal having very abrupt (sudden) amplitude changes, like a square wave, contains higher-frequency spectral content than a single-frequency sinusoidal signal that has more gradual (smooth) amplitude changes.

在所有模拟和数字信号处理系统的设计过程中,必须预料到这一特性。

This characteristic must be anticipated during the design of all analog and digital signal processing systems.

谐波失真

Harmonic Distortion

在实践中,谐波可能是有害的。原因如下:想想图 3-12(a) 中所示的漂亮干净的模拟 5 Hz 正弦波及其频域频谱,如图 3-12(b) 所示。

In practice, harmonics can be detrimental. Here’s why: think of the nice clean analog 5 Hz sine wave shown in Figure 3-12(a) with its frequency-domain spectrum that is shown in Figure 3-12(b).

Image

图 3-125 Hz 正弦波电压:(a) 时域图;(b) 光谱图。

Figure 3-12 A 5 Hz sine wave voltage: (a) time-domain plot; (b) spectral plot.

现在,假设图 3-12(a) 中的 5 Hz 正弦波电压施加到工作有缺陷的放大器上,放大器的输出是图 3-13(a) 所示的失真电压波形。放大器的不完美性能使原始纯正弦波输入信号的正峰值和负峰值变平。这种失真称为谐波失真,因为放大器输出信号的频谱包含不需要的谐波频谱分量,如图 3-13(b) 所示。现在让我们明确一下:图 3-13(b) 中的谐波不会导致图 3-13(a) 中的失真波形。图 3-13(a) 波形失真的事实是产生图 3-13(b) 中谐波的原因。

Now let’s say the 5 Hz sine wave voltage in Figure 3-12(a) was applied to an amplifier whose operation was flawed, and the output of the amplifier is the distorted voltage waveform shown in Figure 3-13(a). The amplifier’s imperfect performance flattened the positive and negative peaks of the original pure sine wave input signal. That distortion is called harmonic distortion because the spectrum of the amplifier’s output signal contains unwanted harmonic spectral components as depicted in Figure 3-13(b). Let’s be clear now: The harmonics in Figure 3-13(b) did not cause the distorted waveform in Figure 3-13(a). The fact that the Figure 3-13(a) waveform is distorted is what produced the harmonics in Figure 3-13(b).

Image

图 3-13失真的 5 Hz 正弦波电压:(a) 时域图;(b) 显示谐波失真的频域频谱。

Figure 3-13 A distorted 5 Hz sine wave voltage: (a) time-domain plot; (b) frequency-domain spectrum showing harmonic distortion.

作为谐波失真的一个工程示例,如果我们用广播电台产生的无线电信号替换图 3-12(a) 中的模拟正弦波,则不完美放大器的失真输出将是所需的无线电台信号加上以较高频率为中心的信号的副本。这种情况是严格禁止的。我们不希望来自一个无线电台的谐波干扰来自附近城市另一个台站的信号。这就是为什么广播电台的发射机经过精心设计,仅在其联邦通信委员会指定的频率上辐射信号。同样,您的手机包含精心设计的过滤器,因此它不会辐射不需要的高频谐波电磁能。我们不希望您手机的传输信号干扰其他人的手机传输。

As an engineering example of harmonic distortion, if we replaced the analog sine wave in Figure 3-12(a) with the radio signal produced by a broadcast radio station, the distorted output of an imperfect amplifier would be the desired radio station signal plus copies of that signal centered at higher frequencies. That scenario is strictly forbidden. We don’t want harmonics from one radio station interfering with the signal from another station in a nearby city. That’s why the transmitters of broadcast radio stations are carefully designed to radiate signals only at their Federal Communications Commission–specified frequencies. Likewise, your cell phone contains carefully designed filters so that it does not radiate undesirable, high-frequency, harmonic electromagnetic energy. We don’t want your phone’s transmitted signal to interfere with someone else’s phone transmissions.

但是,对于音频信号,谐波可能是一件好事。乐器生成音频音调和独特的多个音频泛音。这些谐波使我们能够区分乐器。如果没有泛音,钢琴弹奏中音 C 的声音与吉他弹奏中音 C 的声音相同。

However, with audio signals, harmonics can be a good thing. Musical instruments generate an audio tone plus distinctive multiple audio harmonics. These harmonics allow us to tell musical instruments apart. Without harmonics, a piano playing a middle-C note would sound the same as a guitar playing middle C.


顺便一提

By the Way

几十年前,摇滚吉他手意识到,如果他们将异常高电平的电吉他信号施加到他们的真空管放大器上,这些放大器的缺点会产生高谐波失真的音符,如图 3-13(b) 所示。结果是音符中充满了咆哮的和声内容,这是摇滚吉他手喜欢的声音。当晶体管放大器出现时,随着它们性能的提高,谐波失真减少了,因此一些摇滚吉他手对第一个晶体管放大器不满意。这使得旧的真空管放大器备受追捧。有传言说滚石乐队主音吉他手 Keith Richards 仍然更喜欢真空管放大器。因为 Richards 没有回复我们的电话,所以您的作者无法证实这个谣言。

Decades ago, rock-n-roll guitarists realized that if they applied unusually high-level electric guitar signals to their vacuum-tube amplifiers, shortcomings in those amplifiers would produce musical notes suffering from high harmonic distortion such as that in Figure 3-13(b). The result was musical notes super-rich in roaring harmonic content, a sound that the rock guitarists liked. When transistor amplifiers came along, with their improved performance, the harmonic distortion was reduced so some rock guitarists weren’t happy with the first transistor amplifiers. This made the old vacuum-tube amplifiers highly sought after. Rumor has it that Rolling Stones lead guitarist Keith Richards still prefers vacuum-tube amplifiers. Because Richards has not returned our phone calls, your authors cannot confirm this rumor.


带宽

Bandwidth

现在我们已经了解了模拟信号频谱的基础知识,我们可以继续讨论另一个重要主题,信号带宽,即信号包含大量频谱能量的频率范围。开始我们讨论带宽的一个好方法是考虑旧的固定电话系统。

Now that we’ve covered the basics of analog signal spectra, we can proceed to another important topic, signal bandwidth, which is the frequency range over which a signal contains significant spectral energy. A good way to start our bandwidth discussion is by considering old landline telephone systems.

人类语音的音频频谱类似于图 3-14(a) 中所示的曲线。当人们对着固定电话的麦克风讲话时,他们的语音信号包含频谱能量,频率范围大约为 80 Hz 至 7 kHz (7,000 Hz),因此可以合理地说人类语音的带宽为 7 kHz。

The audio spectrum of human speech looks something like the curve shown in Figure 3-14(a). When people speak into the microphone of a landline telephone, their speech signals contain spectral energy that covers a frequency range of roughly 80 Hz to 7 kHz (7,000 Hz), so it’s reasonable to say that human speech has a bandwidth of 7 kHz.

Image

图 3-14人类语音带宽:(a) 全频谱带宽;(b) 电话公司滤波后的频谱带宽。

Figure 3-14 Human speech bandwidth: (a) full spectral bandwidth; (b) spectral bandwidth after telephone company filtering.

出于许多实际的工程原因,电话公司要求模拟电话语音信号仅包含略小于 4 kHz 的频率范围内的能量。因此,在电话公司的设施中,电话语音信号通过模拟滤波器,该滤波器有效地消除了低于 300 Hz 和高于约 3.5 kHz 的频谱能量。因此,电话公司从一部电话传输到另一部电话的音频信号的带宽限制为 3.2 kHz,如图 3-14(b) 所示。

For a number of practical engineering reasons, the telephone company requires that an analog telephone speech signal contain energy only over a frequency range of somewhat less than 4 kHz. As a result, at the telephone company’s facility a telephone speech signal is passed through an analog filter that effectively eliminates spectral energy below 300 Hz and above about 3.5 kHz. Thus, the audio signal that the telephone company transmits from one telephone to another is limited in its bandwidth to 3.2 kHz, as shown in Figure 3-14(b).

工程师使用的带宽有许多不同的定义。但是,现在我们将 bandwidth 一词视为信号包含大量频谱能量的频率范围。电话公司之所以可以将模拟语音信号的带宽限制为 3.2 kHz,是因为人类语音的大部分频谱能量都在 300 Hz 到 3.5 kHz 的范围内,人类可以轻松理解带宽限制为 3.2 kHz 的语音信号。这不是高保真语音,但肯定足以通过电话进行对话。

There are a number of different definitions for bandwidth used by engineers. However, for now we’ll consider the word bandwidth to mean the frequency range over which a signal contains significant spectral energy. The reason the telephone company could limit the bandwidth of analog speech signals to 3.2 kHz is because most of the spectral energy of human speech is in the range of 300 Hz to 3.5 kHz, and humans can easily understand a speech signal that is limited in bandwidth to 3.2 kHz. It’s not high-fidelity speech, but certainly good enough to hold a conversation over the telephone.

调幅 (AM) 无线电台广播带宽为 5 kHz 的音频信号。这就是为什么 AM 收音机的音频听起来比电话音频更好。更好的是,调频 (FM) 广播电台为每个左声道和右声道广播音频信号,这些信号的带宽略小于 15 kHz。这就是为什么来自 FM 广播电台的管弦乐队音乐听起来如此美妙的原因。音频极客将 FM 音频称为高保真度。(附录 C 提供了有关 AM 和 FM 无线电信号的其他信息。

Amplitude modulation (AM) radio stations broadcast audio signals that have bandwidths of 5 kHz. That’s why the audio from your AM radio sounds better than telephone audio. Better still, frequency modulation (FM) radio stations broadcast audio signals, for each of the left and the right channels, that have bandwidths just slightly less than 15 kHz. That’s why orchestra music sounds so good coming from an FM radio station. Audio geeks refer to FM audio as high fidelity. (Appendix C provides additional information concerning AM and FM radio signals.)

让我们回到我们之前讨论的音频信号来结束模拟信号带宽的讨论。图 3-15(a) 显示了图 2-12(a) 中 Kirk 上尉的“Mister Spock”音频语音信号的频谱。请注意,图 2-12(a) 是时域图,图 2-15(a) 是频域图。在图 3-15(a) 中,我们看到语音信号的带宽约为 4 kHz。

Let’s conclude our analog-signal bandwidth discussion by returning to an audio signal we discussed earlier. Figure 3-15(a) shows the spectrum of Capt. Kirk’s “Mister Spock” audio speech signal in Figure 2-12(a). Note that Figure 2-12(a) is a time-domain plot and Figure 2-15(a) is a frequency-domain plot. In Figure 3-15(a), we see that the speech signal has a bandwidth of roughly 4 kHz.

Image

图 3-15音频语音信号 “Mister Spock” 的频谱。

Figure 3-15 Spectrum of the audio speech signal “Mister Spock.”

如果该音频语音电压信号通过电话公司的滤波器,该滤波器仅传递 300 Hz 至 3,500 Hz 范围内的频谱能量,则滤波器的输出频谱将为图 3-15(b) 所示。您看到图 3-15(a)图 3-15(b) 中的光谱有什么区别了吗?好了 — 您现在拥有了检查信号频谱的经验!因为图 3-15(a) 中的绝大多数频谱能量确实通过滤波器,所以在接收电话的扬声器输出处很容易察觉到过滤后的语音信号。

If that audio speech voltage signal had been passed through the telephone company’s filter, which only passes spectral energy in the range of 300 Hz to 3,500 Hz, the output spectrum of the filter would be that shown in Figure 3-15(b). Do you see the difference between the spectra in Figure 3-15(a) and Figure 3-15(b)? There you go—you now have experience in examining signal spectra! Because the vast majority of the spectral energy in Figure 3-15(a) does pass through the filter, the filtered speech signal would be easily perceptible at the receiving telephone’s loudspeaker output.

其他带宽

The Other Bandwidth

不幸的是,带宽这个词的定义不正确,这在当今非常普遍。当您购买新手机时,销售人员可能会告诉您类似“您手机的带宽为 1.4 兆位/秒”。他或她应该说的是,“您手机的二进制数据传输速率为 1.4 兆位/秒。(我们将在后面的章节中解释二进制位。对我们来说,术语带宽具有非常具体的含义,即以 Hz 为单位的频带宽度而不是二进制数据传输速率。

Unfortunately, there is an incorrect definition of the word bandwidth that’s very common nowadays. When you buy a new cell phone, the salesperson may tell you something like, “Your phone’s bandwidth is 1.4 megabits/second.” What he or she should have said was, “Your phone’s binary data transfer rate is 1.4 megabits/second.” (We explain binary bits in a later chapter.) For us, the term bandwidth has the very specific meaning of the width of a frequency band, measured in Hz, not a binary data transfer rate.

我们不知道带宽这个词是什么时候开始用来描述二进制数据传输速率的,但遗憾的是,这个用词不当肯定会继续存在。

We don’t know just when the word bandwidth began to be used to describe binary data transfer rates but, sadly, that misnomer is surely here to stay.

您应该记住什么

What You Should Remember

在本章中,我们介绍了频率的概念以及如何通过频域频谱来描述模拟信号。我们学到的关于模拟信号频谱的所有概念都将帮助我们理解数字信号。

In this chapter, we covered the concept of frequency as well as how we can describe an analog signal by its frequency-domain spectrum. All of the concepts we learned about the spectra of analog signals will help us understand digital signals.

本章中应记住的概念是:

The concepts you should remember from this chapter are:

• 周期性变化的电压,如正弦波和余弦波电压,在信号处理领域很常见。

• Periodically varying voltages, like sine and cosine wave voltages, are common in the world of signal processing.

• 周期性电压每单位时间的重复率称为频率。

• The repetition rate, per unit time, of a periodic voltage is called frequency.

• 频率通常以赫兹 (Hz) 为单位进行测量。1 Hz 等于每秒一个周期。

• Frequency is most commonly measured in units of hertz (Hz). One Hz is equal to one cycle per second.

• 我们可以通过模拟信号的频域频谱内容来描述模拟信号。

• We can describe analog signals by their frequency-domain spectral content.

• 周期性变化的电压频谱,除单频正弦波和余弦波电压外,包含一个基频分量和谐波频率分量(高频正弦波)。

• The spectrum of periodically varying voltages, except single-frequency sine and cosine wave voltages, contains a fundamental frequency component plus harmonic frequency components (higher frequency sinusoids).

• 信号包含大量频谱能量的频率范围称为信号带宽。

• The frequency range over which a signal contains significant spectral energy is called the bandwidth of the signal.

4. 数字信号及其生成方式

4. Digital Signals and How They Are Generated

什么是数字信号?

What Is a Digital Signal?

直到 1980 年代初,我们在日常生活中经历的绝大多数信号,例如光和声音信号,本质上都是模拟信号。但是,正如第 1 章的表 1.1 所示,数字时钟、手机、便携式音乐播放器和数字电视的出现已经使我们的世界大部分地区都变成了数字世界。因此,我们有理由问:“数字这个词是什么意思?什么是数字信号?我们将在以下部分中回答这些问题。

Until the early 1980s, the vast majority of the signals that we experienced in our daily lives, such as light and sound signals, were analog in nature. But the advent of digital clocks, cell phones, portable music players, and digital television has changed much of our world to digital as indicated by Table 1.1 in Chapter 1. So it’s reasonable to ask, “What does the word digital mean? What is a digital signal?” We answer those questions in the following sections.

数字化的概念

The Notion of Digital

语言的发展是一个复杂且不可预测的现象。据我们所知,我们对数字一词的定义起源于用手指计数的概念。(拉丁语 digitus 的意思是手指。如果有人要求您从右手举起任何非零数量的手指,您有五个选择。您可以举起 1、2、3、4 或 5 个手指(是的,在本次讨论中,拇指被提升为手指)。因此,竖起的手指数量将是仅有的五种可能性之一。因此,我们可以说您举起的手指数是一个数字。因此,对我们来说,数字这个词意味着从明确定义的离散可能性中选择的一种可能性。数字号码是从一组固定号码中选择的单个号码。不用担心;我们将通过许多示例来阐明 digital 的含义。

The development of language is a complicated, and unpredictable, phenomenon. As far as we can tell, our definition of the word digital originated from the notion of counting with your fingers. (The Latin word digitus means finger.) If someone asked you to hold up any nonzero number of fingers from your right hand, you have five choices. You could hold up 1, 2, 3, 4, or 5 fingers (yes, the thumb is promoted to a finger for this discussion). The number of upheld fingers thus will be one of only five possibilities. As such, we could say that the number of fingers you hold up is a digital number. So, for us the word digital means one possibility selected from a well-defined number of discrete possibilities. A digital number is a single number selected from a fixed set of numbers. Don’t worry; we’ll clarify the meaning of digital with many examples.

至于术语数字信号,不幸的是,在两个不同的电子领域有两种公认的定义。这两个定义非常不同,因此我们将在以下部分中仔细描述这两个定义。

As for the term digital signal, unfortunately there are two accepted definitions in two different fields of electronics. Those two definitions are quite distinct so we’ll carefully describe both definitions in the following sections.

数字信号:定义 #1

Digital Signals: Definition #1

数字信号的第一个定义实际上与我们在本文中所说的模拟信号有关。在手机、高清电视和计算机中都有模拟电压信号,如图 4-1 所示的信号。(工程师实际上可以使用图 2-3(a) 所示的示波器查看图 4-1 中所示的电压波形。

The first definition of a digital signal is actually related to what we’ve been calling an analog signal in this book. There are analog voltage signals in cell phones, high-definition televisions, and computers that look like the signal shown in Figure 4-1. (Engineers can actually see the voltage waveforms shown in Figure 4-1 with an oscilloscope such as that depicted in Figure 2-3(a).)

Image

图 4-1一种称为数字信号的模拟电压信号。

Figure 4-1 An analog voltage signal that’s called a digital signal.

这些电压在电子硬件内部代表某种信息。例如,在桌面打印机上打印文档时,图 4-1 中所示的电压会通过电缆从计算机传输到打印机。打印机旨在解释电压信号并打印适当的字母、数字或二维图像(图片)。图 4-1 电压波形通常被称为数字信号,因为电压在任何时刻都处于只有两个可能的电压电平之一。在我们的示例中,电压在任何时刻都是 0 伏或 4 伏。

Those voltages, inside electronic hardware, represent some sort of information. For example, when you print a document on your desktop printer, voltages like that shown in Figure 4-1 are transmitted from your computer through a cable to your printer. Your printer is designed to interpret the voltage signal and print the appropriate letters, numbers, or perhaps a two-dimensional image (a picture). The Figure 4-1 voltage waveform is often referred to as a digital signal because the voltage at any instant in time is at one of only two possible voltage levels. At any instant in time, the voltage in our example is either zero volts or 4 volts.

深思熟虑的读者现在会问:“等一下!如果我在一张纸上画出图 4-1 电压,我的笔尖永远不会离开纸的表面。这难道不是模拟信号的主要特性吗?答案是肯定的。图 4-1 中的电压确实是一个模拟电压信号,但是因为它在任何时刻的电压值总是两个可能的值之一,所以被电子硬件设计工程师称为数字信号。因此,就我们的目的而言,我们只接受这样一个事实,即图 4-1 电压通常被构建电子硬件的工程师称为数字信号。

The thoughtful reader would now ask, “Wait a second! If I drew the Figure 4-1 voltage on a piece of paper, the tip of my pencil would never leave the surface of the paper. Isn’t that a primary characteristic of analog signals?” The answer is yes. The voltage in Figure 4-1 is indeed an analog voltage signal, but because its voltage value at any instant in time is always one of two possible values, it’s called a digital signal by electronic hardware design engineers. So for our purposes, we’ll merely accept the fact that the Figure 4-1 voltage is commonly called a digital signal by engineers who build electronic hardware.

数字信号定义 #1:在两个不同电压值之间交替的模拟电压信号。

Digital signal definition #1: An analog voltage signal that alternates between two distinct voltage values.

数字信号:定义 #2

Digital Signals: Definition #2

数字信号的第二个也是更常见的定义需要仔细解释。举个日常例子,当你看一个带有旋转分针和时针的标准挂钟时,分针可能会指向数字 2,告诉我们已经过了整点 10 分钟,如图 4-2(a) 所示。在接下来的 60 秒内,分针缓慢旋转到整点后 11 分钟,如图 4-2(b) 所示。但是,在数字时钟上,在小时后 10 分钟,分钟显示屏将显示值 10。在接下来的 59 秒内,分钟显示屏继续显示数字 10。然后突然间,数字时钟的分钟显示迅速切换到数字 11。与旋转指针时钟不同,数字时钟不能显示整点后 10 到 11 分钟之间的任何时间。因此,数字时钟上显示的分钟是一个数字,它只能是 60 个可能的整数之一,可以是 00、01、02、03、. . . 、58 或 59。

The second and more common definition of digital signal requires careful explanation. As an everyday example, when you look at a standard wall clock with its rotating minute and hour hands, the minute hand may point to the number 2 telling us it’s 10 minutes past the hour, as shown in Figure 4-2(a). Over the next 60 seconds, the minute hand slowly rotates to 11 minutes past the hour as shown in Figure 4-2(b). On a digital clock, however, at 10 minutes past the hour the minutes display will show the value 10. And for the next 59 seconds, the minutes display continues to show the number 10. Then all of a sudden, the digital clock’s minute display quickly switches to the number 11. Unlike a rotary-hand clock, a digital clock cannot show any time between 10 and 11 minutes past the hour. So, the minutes display on a digital clock is a digital number that can only be one of 60 possible whole numbers, either 00, 01, 02, 03, . . . , 58, or 59.

Image

图 4-2旋转钟的分针位置:(a) 整点后 10 分钟;(b) 整点后 11 分钟。

Figure 4-2 A rotary clock’s minute hand positions: (a) 10 minutes after the hour; (b) 11 minutes after the hour.

在类似的示例中,典型的汽车仪表板车速表显示汽车的速度,以英里/小时 (mph) 为单位,如图 4-3(a) 所示。车速表的指针从左向右平滑移动。但是,一些现代汽车具有数字车速表,可显示易于阅读的数字,如图 4-3(b) 所示。我们可以自由地将图 4-3(b) 中的数字 48 称为数字数字,就像我们对数字时钟上的分钟显示所做的那样。

In a similar example, the typical automobile dashboard speedometer shows the car’s speed, in miles per hour (mph), as depicted in Figure 4-3(a). The speedometer’s pointer moves smoothly from left to right. However, some modern autos have digital speedometers that display an easy-to-read number, as shown in Figure 4-3(b). We are at liberty to call that number 48 in Figure 4-3(b) a digital number, as we did with the minutes display on a digital clock.

Image

图 4-3汽车车速表显示:(a) 老式模拟指针显示;(b) 数字显示。

Figure 4-3 Automobile speedometer displays: (a) old-style analog pointer display; (b) digital display.

好,现在让我们考虑一个数字序列。我们首先回顾图 2-1 中密歇根州马凯特的低温和高温度曲线。我们在图 4-4 中重复低温曲线。

OK, let’s now consider a sequence of digital numbers. We start by recalling the low and high Marquette, Michigan, temperature curves in Figure 2–1. We repeat the low temperature curve here in Figure 4-4.

Image

图 4-4平均室外低温在 马凯特, 密歇根州。

Figure 4-4 Average low outdoor temperatures in Marquette, Michigan.

我们没有图 4-4 的低温模拟曲线,而是假设我们有下表,该表是一年内每个月第一天获得的低温。

Instead of having the Figure 4-4 low temperature analog curve available to us, assume we have the following table of low temperatures obtained on the first day of each month over a period of one year.

如果我们把表 4.1 的 12 个数字序列画成点,每个数字一个点,我们得到的曲线如图 4-5 所示。该点图很重要,因为表 4.1 中的温度值列表也称为数字信号,图 4-5 中的图是该信号的图形描述。

If we plot Table 4.1’s sequence of 12 numbers as dots, one dot per number, we have the plot shown in Figure 4-5. That plot of dots is important because the list of temperature values in Table 4.1 is also called a digital signal and the plot in Figure 4-5 is a graphical depiction of this signal.

Image

表 4.1低温(每月第一天)

Table 4.1 Low Temperatures (First Day of the Month)

Image

图 4-5室外低温的离散序列。

Figure 4-5 Discrete sequence of low outdoor temperatures.

为了在这里建立我们的术语,我们说表 4.1 中的 12 个数字列表可以称为:

To establish our terminology here, we say the list of 12 numbers in Table 4.1 can be called:

• 数字信号(最不合适但迄今为止最常见的术语),

• a digital signal (the least appropriate but by far the most common terminology),

数字序列 (偶尔使用),或

• a digital sequence (occasionally used), or

离散序列 (最合适的术语,但不常用)。

• a discrete sequence (the most appropriate terminology but not commonly used).

我们将遵守通用术语并声明:

We will comply with common terminology and state:

数字信号定义 #2:一系列离散的单个数字。

这是我们在本书的其余部分将使用的定义。

Digital signal definition #2: A sequence of discrete, individual numbers.

This is the definition we’ll use throughout the remainder of this book.

现在我们来看图 4-4 中平滑变化的模拟温度信号与图 4-5 中离散的、周期性间隔的数字温度信号之间的根本区别。这两个信号都告诉我们密歇根州马凯特市一年内的低温室外温度是如何变化的。稍后,我们将了解在哪些情况下数字信号比模拟信号更有用。

We turn now to the fundamental difference between the smoothly changing analog temperature signal in Figure 4-4 and the discrete, periodically spaced-in-time, digital temperature signal in Figure 4-5. Both signals tell us how the low outdoor temperature varies over a period of one year in Marquette, Michigan. Later, we’ll learn in what situations digital signals are more useful to us than are analog signals.

数字信号是如何产生的

How Digital Signals Are Generated

有三种常用方法可用于生成数字信号。我们将在以下段落中讨论每种方法。

There are three common methods used to generate digital signals. We discuss each method in the following paragraphs.

通过观察生成数字信号

Digital Signal Generation by Observation

图 4-5 中的数字信号是通过观察获得的。一年多的时间里,在这个月的第一天,有人观察了温度计并记录了当天最冷的温度。然后,观察者在表 4.1 中列出了这 12 种温度。数字信号代表表 4.1 中列出的物理温度量,是通过观察获得的。

The digital signal in Figure 4-5 was obtained by observation. Over a year’s time, on the first day of the month, someone observed a thermometer and recorded the coldest temperature for that day. The observer then listed those 12 temperatures in Table 4.1. The digital signal, representing the physical quantity of temperature listed in Table 4.1, was obtained by observation.

观察生成的数字信号的另一个示例是 Apple (Apple Inc.) 股票的每日收盘价。这些价格在三年内观察并以美元为单位,形成一个数字信号,即一个离散的数字序列,如图 4-6(a) 所示。

Another example of a digital signal generated by observation is the daily closing prices of one share of Apple (Apple Inc.) stock. The prices, observed over a three-year period and measured in U.S. dollars, form a digital signal, a discrete sequence of numbers, as shown in Figure 4-6(a).

Image

图 4-6一股苹果股票的收盘价:(a) 以点表示的每日价格;(b) 首选的显示方法,即用线条连接点,然后删除点。

Figure 4-6 Closing price of one share of Apple stock: (a) daily prices plotted as dots; (b) preferred display method of connecting the dots with lines, and then deleting the dots.

股票市场分析师通常会记录、编译和检查此类历史每日股票价格。然而,分析师不是像我们在图 4-6(a) 中所做的那样将价格序列绘制成点,而是用线条连接点,然后删除这些点,产生如图 4-6(b) 所示的锯齿状曲线。请注意,图 4-6(b) 中的曲线不是连续的模拟信号。这只是以图形方式描述图 4-6(a) 中数字数据的流行方式。

Stock market analysts routinely record, compile, and examine historical daily stock prices like these. However, rather than plotting a sequence of prices as dots, similar to what we did in Figure 4-6(a), analysts connect the dots with lines and then delete the dots, producing a jagged curve as shown in Figure 4-6(b). Note that the curve in Figure 4-6(b) is not a continuous analog signal. It’s merely the popular way to graphically depict the digital data in Figure 4-6(a).

至于图 4-6 中的信息内容,很多读者会觉得那个图没什么兴趣。但是,对于那些在 2012 年夏天买卖 Apple Inc. 股票的读者来说,图 4-6 包含重要信息。

As for the information content of Figure 4-6, many readers will find that figure of little interest. However, for those readers who bought or sold shares of Apple Inc. stock during the summer of 2012, Figure 4-6 contains crucial information.


顺便一提

By the Way

借助互联网,您可以查看在任何主要证券交易所注册的任何公司的历史股票价格。http://finance.yahoo.com,您可能希望访问此 Web 站点,以查看您雇主的历史和当前股票价格。

Thanks to the Internet, you can examine the historical stock share prices of any company registered with any major stock exchange. You may want to visit this Web site, http://finance.yahoo.com, to check the historical and current stock price of your employer.


通过软件生成数字信号

Digital Signal Generation by Software

生成数字信号的另一种方式是使用计算机软件。工程师经常使用软件来创建分析或测试目的所需的数字信号。他们努力的结果是数字信号,即存储在计算机内存中的数字列表,可以代表工程师选择的任何物理量。在后面的章节中,我们将介绍软件生成的数字信号的几个示例。

Another way digital signals are generated is through the use of computer software. Engineers frequently use software to create digital signals needed for analysis or testing purposes. The results of their efforts are digital signals, lists of numbers stored in a computer’s memory that may represent any physical quantity of an engineer’s choice. In later chapters, we’ll look at several examples of software-generated digital signals.

通过对模拟信号进行采样来生成数字信号

Digital Signal Generation by Sampling an Analog Signal

到目前为止,生成数字信号的最常见方式是采样,在这个过程中,我们用数字列表表示模拟信号。采样过程如图 4-7 所示。模拟电压信号被施加到称为模数转换器的小型电子设备上。为方便起见,我们将模数转换器称为 ADC。ADC 的输出是存储在计算机内存中的数字序列 n1、n2、n3 . . . 。数字序列是通过对模拟电压信号进行采样而获得的数字信号。

By far the most common way digital signals are generated is by sampling, a process by which we represent an analog signal with a list of numbers. The process of sampling is depicted in Figure 4-7. An analog voltage signal is applied to a small electronic device called an analog-to-digital converter. For convenience, we’ll refer to an analog-to-digital converter as an ADC. The output of the ADC is a sequence of numbers, n1, n2, n3, . . . , that is stored in a computer’s memory. The sequence of numbers is our digital signal obtained by sampling an analog voltage signal.

Image

图 4-7采样:将模拟信号转换为数字信号以存储在计算机内存中。

Figure 4-7 Sampling: converting an analog signal to a digital signal for storage in computer memory.

对于我们的采样过程来说,施加到 ADC 的周期性间隔时钟电压脉冲至关重要。这些脉冲决定了转换器测量模拟电压的瞬时值并生成代表该值的单个输出数字的确切时刻。让我们看一个对模拟电压信号进行采样的示例。

Critical to our sampling process are the periodically spaced clock voltage pulses applied to the ADC. Those pulses determine the exact instants in time when the converter will measure the analog voltage’s instantaneous value and generate a single output number representing that value. Let’s look at an example of sampling an analog voltage signal.

我们在图 4-8 中显示了采样过程的输入和输出。假设 ADC 的模拟电压输入信号是图 4-8(a) 所示的正弦电压。如图所示,我们在垂直箭头表示的等距时刻对模拟 ADC 输入电压进行采样。

We show the input and output of a sampling process in Figure 4-8. Let’s assume the analog voltage input signal to an ADC is the sinusoidal voltage shown in Figure 4-8(a). As shown in that figure, we sample the analog ADC input voltage at the equally spaced instants in time represented by the vertical arrows.

Image

图 4-8模数转换器操作:(a) 模拟信号输入;(b) 数字信号输出。

Figure 4-8 Analog-to-digital converter operation: (a) analog signal input; (b) digital signal output.

采样值,即 ADC 输出的 20 个数字序列,列于表 4.2 中。这些样本值也在图 4-8(b) 中以图形方式表示为点。每个点表示采样序列的一个样本值,即一个数字。

The sampled values, the sequence of 20 numbers output by the ADC, are listed in Table 4.2. Those sample values are also graphically depicted as dots in Figure 4-8(b). Each dot represents one sample value, one number, of the sampled sequence.

Image

表 4.2正弦数字信号的采样值

Table 4.2 Sample Values of a Sinusoidal Digital Signal

如果我们自己在一张纸上画出 ADC 输出序列,时间在横轴上,如图 4-8(b) 所示,我们的笔尖或铅笔的尖端确实会离开纸的表面,这与绘制连续的模拟信号不同。

If we took it upon ourselves to draw the ADC output sequence on a piece of paper with time on the horizontal axis as in Figure 4-8(b), the tip of our pen or pencil would indeed leave the surface of the paper, unlike drawing a continuous analog signal.

表 4.2 中的数字序列包括 ADC 的输出数字信号,这些数字可以存储在计算机的内存中。我们将 ADC 输出采样值(图 4-8(b) 中以点表示的序列号)称为图 4-8(a) 中模拟信号的采样版本。所以你在这里。表 4.2 中列出的数字序列,由图 4-8(b) 中的点表示,是一个数字信号。

The sequence of numbers in Table 4.2 comprises the ADC’s output digital signal, and those numbers can be stored in a computer’s memory. We refer to the ADC output sample values, the sequence numbers represented as dots in Figure 4-8(b), as a sampled version of the analog signal in Figure 4-8(a). So there you are. The sequence of numbers listed in Table 4.2, and represented by the dots in Figure 4-8(b), is a digital signal.

数字信号的采样率

The Sample Rate of a Digital Signal

在数字信号处理 (DSP) 领域,每个数字信号序列都有一个与之关联的采样率。数字信号的采样率是信号样本的重复率,以每单位时间的样本数为单位。数字信号的采样率非常重要。在图 4-7 中,n1、n2、n3 的采样率......Digital signal 是用于启动模拟电压信号转换的 clock 信号的重复率 (频率)。采样率的概念,即模拟信号的采样频率,相当容易理解。

In the world of digital signal processing (DSP), every digital signal sequence of numbers has what is called a sample rate associated with it. The sample rate of a digital signal is the repetition rate of the signal’s samples, measured in samples per unit of time. And the sample rate of a digital signal is extraordinarily important. In Figure 4-7, the sample rate of the n1, n2, n3, . . . digital signal is the repetition rate (the frequency) of the clock signal used to initiate the conversion of the analog voltage signal. The notion of sample rate, how often an analog signal is sampled, is fairly easy to understand.

例如,如果有人向您发送了一封电子邮件,其中列出了表 4.2 中的 20 个数字信号样本值,而您创建了自己的图 4-8(b) 版本,那么您就错过了一条重要信息。您不知道为在绘图中生成数字信号而采样的模拟正弦波的频率是多少。正弦波是每秒重复一次、每 10 秒重复一次,还是每周重复一次?另一方面,如果您知道通过电子邮件发送的数字信号的采样率是多少,比如 60 个样本/秒,那么您将能够逐步完成算术并确定:

For example, if someone sent you an e-mail listing the 20 digital signal sample values in Table 4.2 and you created your own version of Figure 4-8(b), you’re missing an important piece of information. You would have no idea what the frequency is of the analog sine wave that was sampled to produce the digital signal in your drawing. Did the sine wave repeat every second, every 10 seconds, or once a week? On the other hand, if you knew what the sample rate of the e-mailed digital signal was, say 60 samples/second, you would then be able to step through the arithmetic and determine that:

• 60 个样本,时间跨度为 1 秒,

• 60 samples spans 1 second of time,

• 20 个样本跨越模拟正弦波的 1 个周期,

• 20 samples spans 1 cycle of the analog sine wave,

• 20 个样本是 1/3 秒 (20/60 = 1/3),

• 20 samples is one-third of a second (20/60 = 1/3),

• 模拟信号的 1 个周期持续三分之一秒,

• 1 cycle of the analog signal lasts one-third of a second,

• 模拟正弦波的 3 个周期持续 1 秒,以及

• 3 cycles of the analog sine wave last 1 second, and

• 模拟正弦波的频率为 3 个周期/秒,即 3 Hz。

• the frequency of the analog sine wave is 3 cycles/second, or 3 Hz.

同样,要完全理解图 4-8(b) 中点表示的数字信号,我们需要知道该数字序列的采样率。

Again, to fully understand the digital signal represented by the dots in Figure 4-8(b), we need to know the sample rate of that sequence of numbers.

为了测试您对采样率的理解,我们问:图 4-5图 4-6(a) 中数字信号的采样率是多少?希望您的答案是:图 4-5 中数字信号的采样率是每月一个样本,图 4-6(a) 中数字信号的采样率是每天一个样本。

To test your understanding of sample rate, we ask: what are the sample rates of the digital signals in Figure 4-5 and in Figure 4-6(a)? Hopefully, your answer is: the sample rate for the digital signal in Figure 4-5 is one sample per month and the sample rate for the digital signal in Figure 4-6(a) is one sample per day.

语音数字信号

A Speech Digital Signal

现在让我们看看一个稍微复杂一点的数字信号。在第 2 章中,我们讨论了一个模拟电压,该电压表示 Kirk 上尉说出“Mister Spock”一词的音频语音信号。我们还更详细地研究了 Mister 一词的第一个音节“Mis”的模拟音频信号。图 2-12(b) 显示了音频音节 “Mis” 的模拟电压波形的详细信息。

Let’s now look at a slightly more complicated digital signal. In Chapter 2, we discussed an analog voltage representing the audio speech signal of Capt. Kirk speaking the words “Mister Spock.” We also looked, in greater detail, at the analog audio signal of the first syllable, “Mis,” of the word Mister. Figure 2-12(b) shows the details of the analog voltage waveform of the audio syllable “Mis.”

该模拟音频 “Mis” 信号的采样版本,即数字信号,如图 4-9(a) 中的点所示。作为一个数字信号,音节比我们想象的要复杂得多,如图 4-9(a) 所示,它看起来像一堆密集的杂乱点。为了帮助我们理解信号的性质,我们可以用直线连接点,如图 4-9(b) 所示。但是,这只是视觉上的轻微改进。为了更清晰地显示,DSP 人员将图 4-9(a) 中的点与线条连接起来,然后删除这些点以获得图 4-9(c)。此简化版本显示数字信号的波动幅度,以便于可视化和理解。是的,图 4-9(c) 看起来像一个模拟信号。但是,在查看此类图时,DSP 工程师意识到该图表示数字信号(离散数字序列),而不是连续模拟信号。

The sampled version of that analog audio “Mis” signal, a digital signal, is shown by the dots in Figure 4-9(a). As a digital signal, the syllable is more complicated than we would expect, as we see in Figure 4-9(a), where it looks like a dense jumble of dots. To help us understand the nature of the signal, we could connect the dots with straight lines as in Figure 4-9(b). However, this is only a slight improvement visually. For more visual clarity, DSP folks connect the dots in Figure 4-9(a) with lines and then delete the dots to obtain Figure 4-9(c). This simplified version shows the fluctuating amplitude of the digital signal so that it’s easier to visualize and understand. Yes, Figure 4-9(c) looks like an analog signal. But in looking at this sort of figure, DSP engineers realize that the figure represents a digital signal (a sequence of discrete numbers) rather than a continuous analog signal.

Image

图 4-9显示数字语音信号 “Mis”:(a) 绘制为点的样本;(b) 由线条连接的点;(c) 用线条连接的点和去掉的点。

Figure 4-9 Displaying the digital speech signal, “Mis”: (a) samples plotted as dots; (b) dots connected by lines; (c) dots connected by lines and dots removed.

图 4-9 数字语音信号的采样率为 11025 个样本/秒。该采样率可能看起来是一个奇怪的值,但它是音频信号处理工程师常用的采样率。四乘以 11,025 是 44,100 个样本/秒,这是用于在光盘 (CD) 上录制音乐数字信号的行业标准采样率。在本章后面,我们将对采样率进行更多介绍。

The sample rate of the Figure 4-9 digital speech signal is 11,025 samples/second. That sample rate might seem like a strange value but it’s a sample rate commonly used by audio signal processing engineers. Four times 11,025 is 44,100 samples/second, which is the industry standard sample rate used for recording the digital signals of music on compact discs (CDs). We have more to say about sample rates later in this chapter.

好了,为了说明为什么对模拟音频信号进行采样以获得数字音频信号是有益的,让我们看一下音频数字信号处理的两个简单示例。

OK, to provide illustrations of why it’s beneficial to sample an analog audio signal to obtain a digital audio signal, let’s look at two simple examples of audio digital signal processing.

数字信号处理示例

An Example of Digital Signal Processing

假设我们在一个音乐工作室工作,一位流行歌手正在录制一首新歌。而且,不幸的是,在歌曲的第三节中,歌手唱了一个跑调的音符。几十年前,整首歌必须重新录制才能纠正这一点。而且,希望歌手在第二次录音中能完美地唱出这首歌,同时保持与第一次录音相同的情感强度。

Let’s say we’re working in a music studio and a pop singer is recording a new song. And say that, unfortunately, during the third verse of the song the singer sings one note off-key. Decades ago, the entire song would have to be rerecorded to correct this. And, hopefully, the singer would sing the song perfectly on key during the second recording while maintaining the same emotional intensity as the first recording.

如今,由于数字信号处理,不再需要通过重新录制整首歌曲来纠正性能错误。今天,歌手的模拟语音信号可以通过模数转换器进行采样,然后将数字信号样本传递给计算机,如图 4-10 所示。在该图中,构成数字人声信号的采样值(数字)序列由 x1、x2、x3 表示。表示法。

Nowadays, thanks to digital signal processing, correcting performance errors by rerecording entire songs is no longer necessary. Today, the singer’s analog voice signal can be sampled by an analog-to-digital converter, and then the digital signal samples are passed to a computer as shown in Figure 4-10. In that figure, the sequence of sampled values (numbers) making up the digital vocal signal are represented by the x1, x2, x3, . . . notation.

Image

图 4-10通过 Auto-Tune® 软件进行数字音频信号处理。

Figure 4-10 Digital audio signal processing by Auto-Tune® software.

现在,我们假设计算机正在运行名为 Auto-Tune® 的商业软件。该软件通过测量歌手演唱的每个音符的音高(频率)来分析录音的所有数字样本。如果软件检测到唱出的音符是跑调的(错误的音高或频率),软件会确定音高上最接近离调音符的键上音符(正确的音高或频率)。然后,软件将 off-key-note 的样本替换为 on-key-note 的样本。

Now let’s assume the computer is running commercial software called Auto-Tune®. This software analyzes all the digital samples of the recording by measuring the pitch (frequency) of each musical note sung by the singer. If the software detects a note sung off-key (wrong pitch or frequency), the software determines the on-key note (correct pitch or frequency) that is nearest in pitch to the off-key note. Then, the software replaces the samples of the off-key note with samples of the on-key note.

例如,假设软件遇到图 4-11(a) 中的点所示的浊音样本序列,并根据歌曲的指定音乐调确定该音符的音高(频率)是跑调的。接下来,软件确定图 4-11(a) 中虚线波形表示的歌曲部分最近的键盘音符。然后,软件将图 4-11(a) 中的离调样本替换为图 4-11(b) 中所示的校正样本,这些样本代表最近的调上音符。请注意 4-11(b) 中校正的样本如何与 4-11(a) 中虚线曲线的键上波形相匹配。

For example, let’s say that the software encounters a sequence of samples of a vocalized note shown by the dots in Figure 4-11(a), and determines that the pitch (frequency) of that note is off-key based on the specified musical key of the song. Next, the software determines the nearest on-key note for that part of the song represented by the dashed-curve waveform in Figure 4-11(a). The software then replaces the off-key samples in Figure 4-11(a) with corrected samples shown in Figure 4-11(b), which represent the nearest on-key note. Notice how the corrected samples in 4-11(b) match the on-key waveform of the dashed curve in 4-11(a).

Image

图 4-11校正跑调音符: (a) 跑调音符(点)的样本和最近的正确音符波形;(b) 校正后的音调音符样本。

Figure 4-11 Correcting an off-key musical note: (a) samples of an off-key musical note (dots) and the nearest correct note’s waveform; (b) samples of the corrected on-key musical note.

音高校正后的 y1、y2、y3、. . .然后将整首歌曲的数字信号样本路由到数模转换器,转换器将它们转换为模拟信号,如图 4-10 所示。(我们将在后面的章节中讨论数模转换器的操作。当模拟信号连接到扬声器时,我们听到歌手的声音,每个音符都完美地在琴键上。

The pitch-corrected y1, y2, y3, . . . digital signal samples of the entire song are then routed to a digital-to-analog converter, which transforms them into an analog signal as shown in Figure 4-10. (We discuss the operation of digital-to-analog converters in a later chapter.) When the analog signal is connected to a loudspeaker, we hear the singer’s voice with every musical note perfectly on-key.

这种音高校正过程不仅用于音乐工作室录制音乐 CD,还用于体育场内挤满尖叫粉丝的现场表演。如果没有现代数字信号处理,这种类型的音高校正是不可能的。

This pitch-correction process is used not only in music studios for recording music CDs, but also in live performances in stadiums filled with screaming fans. This type of pitch correction would be impossible without modern digital signal processing.


顺便一提

By the Way

Auto-Tune 软件让音乐行业的人的生活更轻松。这是个好消息。坏消息是,您再也无法聆听您最喜欢的歌手的声音,并知道您是在聆听他们的自然声音还是他们的 Auto-Tune 校正声音。事实证明,带有著名艺术家偶尔跑调演唱的旧黑胶唱片通常比更正、重新制作的 CD 对应物更值钱。

Auto-Tune software makes life easier for people in the music business. That’s the good news. The bad news is that you can never again listen to your favorite singer and know whether you’re listening to their natural voice or to their Auto-Tune-corrected voice. As it turns out, old vinyl albums with a famous artist occasionally singing off-key are often worth much more money than their corrected, re-mastered CD counterparts.


数字信号处理的另一个例子

Another Example of Digital Signal Processing

要了解为什么对模拟音频信号进行采样以获得数字信号是有益的第二个示例,让我们考虑一下 1900 年代中期电话的工作原理。

To understand our second example of why sampling an analog audio signal to obtain a digital signal is beneficial, let’s consider how telephones worked in the mid-1900s.

你们中的一些人可能已经足够老了,还记得图 4-12 中所示的旋转拨号固定电话。要拨打电话,用户必须将听筒从挂机上提起,将手指插入圆形表盘上适当的编号孔中,然后顺时针旋转表盘,直到停止。当用户移开手指时,旋转弹簧将表盘旋转回其原始位置。当表盘逆时针旋转时,一个电气开关关闭,然后多次打开,向电话公司的交换站发送电脉冲。(这类似于快速多次打开和关闭电灯开关。如果您从拨号盘上的数字 4 孔开始拨号,则会向电话公司传输四个电脉冲。要拨打本地电话,您必须再重复此旋转拨号过程六次,目标电话号码的七位数字中的每一位都重复一次。

Some of you might be old enough to remember the rotary-dial landline telephone shown in Figure 4-12. To place a call, the user had to lift the handset off the hook, insert a finger in the appropriate numbered hole in the round dial, and rotate the dial clockwise until it encountered a stop. When the user removed his or her finger, a rotary spring spun the dial back to its original position. As the dial spun counter clockwise, an electrical switch was closed and then opened multiple times sending electrical pulses to the telephone company’s switching station. (It was similar to quickly flicking a light switch on and off multiple times.) If you started your dialing from the number 4 hole in the dial, four electrical pulses were transmitted to the phone company. To make a local phone call you had to repeat this rotary dialing process six more times, once for each of the seven digits of the destination phone’s telephone number.

Image

图 4-12旋转拨号电话。(来自 Bluehand/Shutterstock)

Figure 4-12 Rotary-dial telephone. (From Bluehand/Shutterstock)

在电话公司的交换站,电气硬件将解释 7 组电脉冲(每个拨打的号码 7 个脉冲),并使用继电器开关自动将电话的电线与目标电话的电线电气连接。由于技术原因,使用早期的旋转拨号电话需要电话公司接线员的协助才能拨打长途电话。(你的祖父母清楚地记得这句话,“请编号”。尽管如此,旋转拨号电话是一项伟大的创新。它消除了本地电话呼叫的操作员协助需求。

At the telephone company’s switching station, electrical hardware would interpret the seven sets of electrical pulses (seven pulses for each number dialed) and automatically, using relay switches, electrically connect your telephone’s wires to the destination telephone’s wires. For technical reasons, using the early rotary-dial telephones required telephone company operator assistance to make long-distance calls. (Your grandparents well remember the phrase, “Number please.”) Be that as it may, the rotary-dial telephone was a great innovation. It eliminated the need for operator assistance for local phone calls.

但技术在进步。由于数字信号处理,在 1960 年代初期,随着我们今天使用的被称为按键式电话的创新,拨打电话变得更加容易。现代电话有一个矩形键盘,如图 4-13 所示,我们用它来打电话。

But technology marched on. Thanks to digital signal processing, making telephone calls became even easier in the early 1960s with the innovation known as the touch-tone telephone that we use today. Modern telephones have a rectangular keypad, shown in Figure 4-13, that we use to make phone calls.

Image

图 4-13按键式电话键盘。

Figure 4-13 Touch-tone telephone keypad.

在按键式电话上,按下一个键会激活两个内部音频振荡器,以产生两个不同的模拟音频音调,其频率取决于按下的键。例如,按下 8 键会产生 852 Hz 的音频音调和 1,336 Hz 的音频音调,它们相加会产生复合模拟音频信号。同样,按下 4 键会产生 770 Hz 的音频音调和 1,209 Hz 的音频音调,它们相加形成复合模拟电压信号,如图 4-14 右侧所示。该复合模拟电压通过电话线传输到电话公司的交换站。

On touch-tone phones, pushing a key activates two internal audio oscillators to generate two distinct analog audio tones whose frequencies depend on which key was pushed. For example, pushing the 8 key generates an 852 Hz audio tone and a 1,336 Hz audio tone that are added together to produce a composite analog audio signal. Likewise, pushing the 4 key generates a 770 Hz audio tone and a 1,209 Hz audio tone that are added together to create a composite analog voltage signal, as shown on the right side in Figure 4-14. That composite analog voltage is transmitted over telephone wires to the telephone company’s switching station.

Image

图 4-14在按键式电话键盘上按下 4 键时生成的复合音频信号(770 Hz 音调加 1,209 Hz 音调)。

Figure 4-14 Composite audio signal (a 770 Hz tone plus a 1,209 Hz tone) generated when the 4 key is pressed on a touch-tone telephone keypad.

当图 4-14 复合模拟信号到达电话公司交换站时,它由模数转换器进行采样,以生成由 4-15(b) 中的点表示的数字信号样本。

When the Figure 4-14 composite analog signal arrives at the telephone company switching station, it is sampled by an analog-to-digital converter to generate the digital signal samples represented by the dots in 4-15(b).

Image

图 4-15按下按键式电话键盘上的 4 键时产生的复合音频信号:(a) 发送到电话公司的模拟信号;(b) 电话公司通过采样产生的数字信号。

Figure 4-15 Composite audio signal created when the 4 key on a touch-tone telephone’s keypad is pressed: (a) analog signal sent to the telephone company; (b) digital signal generated, by sampling, at the telephone company.

模数转换的过程如图 4-16 所示。数字样本随后被路由到电子硬件,这些硬件执行数字信号处理操作,以识别复合信号中包含的两个音调的频率。这决定了电话呼叫者按下了哪个键。数字信号处理实现了一系列音调检测器,如图 4-16 所示。如果呼叫者按下电话的 4 键,则 770 Hz 和 1,209 Hz 探测器的输出将被激活,并且系统确定确实按下了 4 键。

That process of analog-to-digital conversion is shown in Figure 4-16. The digital samples are subsequently routed to electronic hardware that performs digital signal processing operations to recognize the frequencies of the two tones contained in the composite signal. This determines which key the telephone caller pressed. The digital signal processing implements an array of tone detectors as shown in Figure 4-16. If the caller presses the telephone’s 4 key, the 770 Hz and 1,209 Hz detectors’ outputs are activated and the system determines that, indeed, the 4 key was pressed.

Image

图 4-16按下 4 键时,电话公司交换站的按键识别过程。

Figure 4-16 Touch-tone telephone pushbutton key recognition process at the telephone company’s switching station when the 4 key is pressed.

那么,按键式家用电话和电话公司交换站中发生的数字信号处理有什么大不了的呢?大优惠是:

So what are the big deals about a touch-tone home telephone and the digital signal processing that takes place in the telephone company’s switching station? The big deals are:

• 在交换站,与用于检测老式旋转拨号电话脉冲的硬件相比,用于检测数字音频音调的硬件尺寸要小得多,成本更低,更可靠,速度更快,能效更高。

• At the switching station, the hardware to detect digital audio tones is significantly smaller in size, less expensive, more reliable, faster, and more power efficient than the hardware used to detect old-style, rotary-dial telephone pulses.

• 与老式旋转电话相比,您的按键式家用电话体积更小、重量更轻、成本更低、操作速度更快。此外,使用按键式家用电话时,长途通话不需要电话接线员协助。

• Your touch-tone home phone is smaller in size, lighter in weight, less expensive, and faster in operation than the old-style rotary phones. In addition, no telephone operator assistance is needed for long-distance calls when using touch-tone home phones.


顺便一提

By the Way

数字电话信号有时由轨道卫星中继,在那里接收信号,然后使用高功率板载放大器中继到另一个大陆。这些卫星位于赤道上方约 23,000 英里处。即使以光速传输,信号的往返也需要大约四分之一秒(称为卫星延迟)。在新闻广播中,当外国记者似乎延迟回答网络演播室的问题时,您会注意到这一点。在国际私人电话中,当你问“你想我吗”时,你的爱人似乎在回答之前犹豫了一下!

Digital telephone signals are sometimes relayed by orbiting satellites where the signal is received and then relayed to another continent using high-power on-board amplifiers. These satellites are about 23,000 miles above the equator. Even at the speed of light, it takes about one-quarter of a second (called satellite latency) for the signal’s round trip. You notice this on newscasts when the reporter on foreign soil seems to delay his or her answer to a question from the network studio. It’s also noticeable in international personal phone calls when you ask, “Do you miss me?” and your sweetheart seems to hesitate before answering!


模拟信号采样的两个重要方面

Two Important Aspects of Sampling Analog Signals

还有两个与对模拟信号进行采样以生成其相应的数字信号相关的其他重要主题。我们将在后续章节中深入介绍这些内容,但在这里简要介绍它们。第一个主题是对模数转换过程中使用的采样率施加的基本限制。第二个是在模数转换器的输出端产生的数字的精确特性。让我们简要地考虑这两个主题。

There are two additional important topics related to sampling an analog signal to generate its corresponding digital signal. We cover these in depth in subsequent chapters, but introduce them briefly here. The first topic is a fundamental restriction imposed on the sample rate used in the analog-to-digital conversion process. The second is the precise characteristics of the numbers produced at the output of an analog-to-digital converter. Let’s briefly consider those two topics.

采样率限制

Sample Rate Restriction

正如我们之前所说,当我们对模拟信号进行采样以生成相应的数字信号时,如图 4-17 所示,我们必须将时钟电压脉冲应用于模数转换器。这些电压脉冲的重复率(以每秒采样数为单位)称为采样过程的采样率(或采样频率)。例如,图 4-9 数字语音信号的采样率为 11,025 个样本/秒。

As we stated earlier, when we sample an analog signal to generate its corresponding digital signal, as shown in Figure 4-17, we must apply clock voltage pulses to the analog-to-digital converter. The repetition rate of those voltage pulses, measured in samples per second, is called the sample rate (or sample frequency) of our sampling process. For example, the sample rate of the Figure 4-9 digital speech signal is 11,025 samples/second.

Image

图 4-17采样:将模拟信号转换为数字信号。

Figure 4-17 Sampling: converting an analog signal to a digital signal.

为了确保数字信号序列 n1、n2、n3 . . 准确表示输入模拟信号,模数转换器时钟信号的采样率 (采样频率) 必须大于输入模拟信号最高频率频谱内容频率的两倍。在数字信号处理领域,这称为奈奎斯特采样准则。例如,图 4-9 中数字语音信号的采样率为每秒 11,025 个样本,远高于正常对话最高频率内容的两倍。

To ensure that the digital signal sequence of numbers, n1, n2, n3, . . . , accurately represents the input analog signal, the sample rate (sampling frequency) of an analog-to-digital converter’s clock signal must be greater than twice the frequency of the highest-frequency spectral content of the input analog signal. In the field of digital signal processing, this is called the Nyquist sampling criterion. For example, the sample rate of 11,025 samples per second for the digital speech signal in Figure 4-9 is well above twice the highest frequency content of normal conversation.

此标准的起源及其违反其不良影响在数字信号处理领域非常重要,因此我们在下一章中专门介绍了这些主题,标题为“采样和数字信号频谱”。

The origin of this criterion and the ill effects of violating it are so important in the world of digital signal processing that we’ve dedicated the next chapter, titled “Sampling and the Spectra of Digital Signals,” to these topics.

模数转换器输出编号

Analog-to-Digital Converter Output Numbers

关于模拟信号采样过程的第二个重要主题是模数转换器产生的数字的性质。

The second important topic regarding the process of sampling an analog signal is the nature of the numbers produced by an analog-to-digital converter.

当我们对模拟信号进行采样时,如图 4-17 所示,数字信号的数字序列不是我们在日常生活中非常熟悉的十进制数字形式。数字信号的数字序列 n1、n2、n3 等采用我们所说的二进制数的形式。第 9 章讨论了二进制数的有趣话题以及我们为什么使用它们。

When we sample an analog signal, as shown in Figure 4-17, the digital signal’s sequence of numbers is not in the form of decimal numbers that we’re so familiar with in our daily lives. The digital signal’s sequence of numbers, n1, n2, n3, . . . , are in the form of what we call binary numbers. The interesting topics of binary numbers and why we use them are discussed in Chapter 9.

采样率转换

Sample Rate Conversion

在阅读数字信号处理文献或听取信号处理工程师的演讲时,您可能会遇到术语抽取插值。这些术语是指更改数字信号的采样率。

When reading the literature of digital signal processing or listening to signal processing engineers, you may encounter the terms decimation and interpolation. Those terms refer to changing the sample rate of a digital signal.

这似乎是一个奇怪的想法,但改变数字信号的采样率(称为采样率转换)有很多应用。事实上,每当您使用手机或智能手机时,都会发生抽取和插值。在以下部分中,我们将简要介绍抽取和插值的过程。

That might seem like a strange idea but changing the sample rate of a digital signal, known as sample rate conversion, has many applications. In fact, both decimation and interpolation take place whenever you use your cell phone or smartphone. In the following sections, we briefly describe the processes of both decimation and interpolation.

抽取

Decimation

无论字典定义如何,对我们来说,术语抽取意味着降低数字信号的采样率。我们将通过一个例子来解释这个想法。

Regardless of its dictionary definition, for us the term decimation means to reduce the sample rate of a digital signal. We’ll explain this idea with an example.

考虑图 4-18(a) 中所示的 250 Hz 正弦波电压信号。如果我们使用模数转换器对模拟信号进行采样,采样率为 3,000 Hz,则生成的数字信号样本将是图 4-18(b) 所示的样本。如果出于某种原因,我们想要原始模拟信号的数字版本,采样率为 1,000 Hz,则无需重复模数转换过程。我们可以简单地将图 4-18(b) 数字信号抽取 3 倍。这种 3 抽取过程意味着我们只需保留图 4-18(b) 信号的每三个样本,并丢弃剩余的样本。仅保留图 4-18(b) 信号的每三个样本会产生我们所需的 1,000 采样率数字信号,如图 4-18(c) 所示。

Consider the 250 Hz sine wave voltage signal shown in Figure 4-18(a). If we sampled that analog signal using an analog-to-digital converter, at a sample rate of 3,000 Hz the resulting digital signal’s samples would be those shown in Figure 4-18(b). If, for some reason, we wanted a digital version of the original analog signal having a sample rate of 1,000 Hz, we would not need to repeat an analog-to-digital conversion process. We could simply decimate the Figure 4-18(b) digital signal by a factor of 3. That decimation-by-3 process means we simply retain every third sample of the Figure 4-18(b) signal, and discard the remaining samples. Retaining only every third sample of the Figure 4-18(b) signal results in our desired 1,000 sample rate digital signal shown in Figure 4-18(c).

Image

图 4-18抽取系数为 3:(a) 原始 250 Hz 模拟正弦波电压信号;(b) 采样率为 3000 Hz 的初始数字信号;(c) 采样率为 1,000 Hz 的 3 抽取数字信号。

Figure 4-18 Decimation by a factor of 3: (a) original 250 Hz analog sine wave voltage signal; (b) initial digital signal having a sample rate of 3000 Hz; (c) decimated-by-3 digital signal having a sample rate of 1,000 Hz.

插值

Interpolation

插值是指增加数字信号采样率的过程。正如我们对抽取所做的那样,让我们通过一个例子来看看这个想法。

Interpolation refers to the process of increasing the sample rate of a digital signal. As we did with decimation, let’s look at that idea by way of an example.

图 4-19(a) 显示了采样率为 1,000 Hz 的数字信号。假设我们希望该信号的采样率为 3,000 Hz(高频采样率)。Interpolation-by-3 过程的第一步是通过在每个原始数字信号的样本之间插入两个零值样本来创建修改后的数字信号。该新数字信号如图 4-19(b) 所示,其中零值样本由圆点表示。如图 4-19(b) 所示,图 4-19(b) 信号的采样率现在是 3,000 Hz。我们的最后一步是将图 4-19(b) 信号通过一个数字低通滤波器,该滤波器的输出信号是我们所需的 interpoled-by-3 信号,如图 4-19(d) 所示。低通滤波器是一种允许低频信号能量通过,但会阻止高频信号能量的过程。我们将在第 8 章中讨论数字低通滤波器的行为和实现。

Figure 4-19(a) shows a digital signal whose sample rate is 1,000 Hz. Suppose we want that signal to have a sample rate of 3,000 Hz (higher-frequency sampling rate). The first step in our interpolation-by-3 process is to create a modified digital signal by inserting two zero-valued samples in between each of the original digital signal’s samples. That new digital signal is shown in Figure 4-19(b), where the zero-valued samples are represented by the circular dots. The sample rate of the Figure 4-19(b) signal is now 3,000 Hz as indicated in Figure 4-19(c). Our final step is to pass the Figure 4-19(b) signal through a digital lowpass filter whose output signal is our desired interpolated-by-3 signal shown in Figure 4-19(d). A lowpass filter is a process that allows low-frequency signal energy to pass, but blocks high-frequency signal energy. We discuss the behavior and implementation of digital lowpass filters in Chapter 8.

Image

图 4-19按 3 倍进行插值:(a) 采样率为 1,000 Hz 的原始数字信号;(b) 插入零值样本的修改后的数字信号;(c) 插值过程信号流;(d) 采样率为 3,000 Hz 的 3 个插值数字信号。

Figure 4-19 Interpolation by a factor of 3: (a) original digital signal having a sample rate of 1,000 Hz; (b) modified digital signal with zero-valued samples inserted; (c) interpolation process signal flow; (d) interpolated-by-3 digital signal having a sample rate of 3,000 Hz.

3 的抽取是简单地丢弃时间样本的单步过程,而 3 的插值是零值样本插入然后进行低通滤波的两步过程。

Where decimation by 3 was a single-step process of simply discarding time samples, interpolation by 3 is a two-step process of zero-valued sample insertion followed by lowpass filtering.

您应该记住什么

What You Should Remember

本章中应记住的概念是:

The concepts you should remember from this chapter are:

短语 digital signal 有两种不同的含义:

• The phrase digital signal has two different meanings:

– 定义 #1:在两个不同的电压值之间交替的模拟电压信号(见图 4-1)。

– Definition #1: An analog voltage signal that alternates between two distinct voltage values (see Figure 4-1).

– 定义 #2:离散的、单独的数字序列(见图 4-5

– Definition #2: A sequence of discrete, individual, numbers (see Figure 4-5.)

我们在本书中使用定义 #2。

We use definition #2 in this book.

• 数字信号,离散的数字序列,可以存储在计算机的内存中。

• Digital signals, discrete sequences of numbers, can be stored in the memory of a computer.

• 数字信号以三种方式产生:

• Digital signals are produced in three ways:

– 观察和收集有意义的数据(见图 4-6(a))

– Observing and collecting meaningful data (see Figure 4-6(a))

– 计算机软件

– Computer software

– 使用模数转换器硬件对模拟信号进行采样(见图 4-7图 4-8)

– Sampling an analog signal using analog-to-digital converter hardware (see Figure 4-7 and Figure 4-8)

• 数字信号具有与之关联的采样率。数字信号的采样率是以每单位时间的样本数为单位测量的信号样本的重复率。例如,图 4-5 中数字信号的采样率为每月 1 个样本。图 4-6(a) 中数字信号的采样率为每天 1 个样本。图 4-9(a) 中数字信号的采样率为每秒 11,025 个样本。

• Digital signals have a sample rate associated with them. The sample rate of a digital signal is the repetition rate of the signal’s samples measured in samples per unit of time. For example, the sample rate for the digital signal in Figure 4-5 is one sample per month. The sample rate for the digital signal in Figure 4-6(a) is one sample per day. The sample rate for the digital signal in Figure 4-9(a) is 11,025 samples per second.

• 为确保数字信号序列准确表示模拟信号,模数转换器时钟信号的采样率 (采样频率) 必须大于模拟信号最高频率频谱内容频率的两倍。

• To ensure that a digital signal sequence accurately represents an analog signal, the sample rate (sampling frequency) of an analog-to-digital converter’s clock signal must be greater than twice the frequency of the highest-frequency spectral content of the analog signal.

• 术语抽取是指降低数字信号采样率的过程。术语 interpolation 是指增加数字信号采样率的过程。

• The term decimation refers to the process of decreasing the sample rate of a digital signal. The term interpolation refers to the process of increasing the sample rate of a digital signal.

5. 采样和数字信号频谱

5. Sampling and the Spectra of Digital Signals

本章解释了数字信号处理工程师在谈论采样和数字信号频谱的主题时所指的含义。这两个主题既重要又有趣,阅读本章后,您将了解此术语的含义。

This chapter explains what digital signal processing engineers mean when they talk about the topics of sampling and the spectra of digital signals. Both subjects are important as well as interesting and, after reading this chapter, you’ll understand the meaning of this terminology.

第 2 章中,我们介绍了模拟信号的概念。这些信号的电压幅度会随着时间的推移而平滑地变化。然后在第 3 章中,我们讨论了模拟信号频谱的重要概念,它是对模拟信号频率成分的描述或测量。尽管您通常不关心日常生活中模拟信号的频谱(除非您正在为吉他或钢琴调音),但频谱分析对信号处理工程师来说具有深远而根本的重要性。在第 4 章中,我们描述了数字信号的概念,数字信号是忠实地表示模拟信号的数字序列。在本章中,我们将研究数字信号频谱的概念。熟悉这些频谱对于任何想要了解数字信号处理基础知识的人来说都是必不可少的。

In Chapter 2, we introduced the idea of analog signals. These are signals whose voltage amplitudes smoothly change in value as time passes. Then in Chapter 3, we discussed the important notion of the spectrum of an analog signal, which is a description, or measure, of the frequency content of an analog signal. Although you’re usually not concerned with the spectra of analog signals in your daily life (unless you’re tuning a guitar or a piano), spectrum analysis is of profound and fundamental importance to signal processing engineers. In Chapter 4, we described the idea of a digital signal, a sequence of numbers faithfully representing an analog signal. In this chapter, we examine the concept of the spectra of digital signals. Familiarity with these spectra is essential for anyone wanting to understand the fundamentals of digital signal processing.

事实证明,就频谱内容而言,当我们将模拟信号转换为其数字信号表示时,会发生令人惊讶的事情。本章解释了这种数字光谱的重要特性。话虽如此,让我们简要回顾一下模拟信号频谱的关键方面,以便为深入了解数字信号频谱做好准备。

And as it turns out, with respect to spectral content, surprising things happen when we convert an analog signal to its digital signal representation. This chapter explains the important characteristics of such digital spectra. With that said, let’s briefly review the key aspects of analog signal spectra in preparation for a solid understanding of digital signal spectra.

模拟信号频谱 — 快速回顾

Analog Signal Spectra—A Quick Review

第 2 章中,我们研究了电压波形的幅度随时间变化的模拟信号。例如,假设模拟工程师的工作是设计一个电子电路,该电路可产生 1,000 Hz 的正弦波音频音调,用作微波炉的蜂鸣器。工程师将适当的电子元件焊接到印刷电路板上,以产生正弦波,如图 5-1 所示,其电压值每秒平稳波动 1,000 次。如果工程师使用扬声器线将正弦波电压连接到扬声器,他将听到纯净的音频音调。

In Chapter 2, we looked at analog signals whose voltage waveforms vary in amplitude as time passes. For example, let’s say an analog engineer’s job is to design an electronic circuit that generates a 1,000 Hz sine wave audio tone for use as a beeper for a microwave oven. The engineer solders the appropriate electronic components to a printed circuit board in order to generate a sine wave, shown in Figure 5-1, whose voltage value smoothly fluctuates 1,000 times per second. If the engineer used speaker wire to connect that sine wave voltage to a loudspeaker, he’d hear a pure audio tone.

Image

图 5-1正弦波电压的时间波形。

Figure 5-1 Time waveform of a sine wave voltage.

此时,音频音调生成任务仅完成了一半。接下来,工程师必须确保他的信号的频谱、频率内容确实是 1,000 Hz。(如果是 25,000 Hz,只有他的狗会听到。因此,工程师将正弦波电压应用于频谱分析仪的输入端,以显示音频信号的频谱。如果频谱显示如图 5-2 所示,则正弦波具有正确的频谱,工程师的工作已完成。这个小故事的重点是,不仅音频信号的时间波形形状很重要,而且信号的频谱也同样重要。

At that point, the audio tone generation task is only half finished. The engineer must next ensure that the spectrum, the frequency content, of his signal is indeed 1,000 Hz. (If it were 25,000 Hz, only his dog would hear it.) So the engineer applies the sine wave voltage to the input of a spectrum analyzer to display the spectrum of the audio signal. If the spectral display is that shown in Figure 5-2, the sine wave has the correct frequency spectrum and the engineer’s job is finished. The point of this little story is that not only is the time waveform shape of the audio signal important, but the spectrum of the signal is equally critical.

Image

图 5-21,000 Hz 正弦波电压的频谱。

Figure 5-2 Spectrum of a 1,000 Hz sine wave voltage.

信号频谱重要性的另一个例子涉及商业 AM(调幅)无线电广播电台。在美国,AM 无线电广播系统经过精心设计,因此其传输信号的频谱带宽永远不会大于 10 kHz (10,000 Hz)。此外,无线电台的中心频率(也称为载波频率)受到仔细控制,以便它们之间至少相隔 10 kHz。

Another example of the importance of signal spectra involves commercial AM (amplitude modulation) radio broadcast stations. In the United States, AM radio broadcast systems are carefully designed so that their transmitted signals never have a spectral bandwidth greater than 10 kHz (10,000 Hz). In addition, the radio stations’ center frequencies (also called carrier frequencies) are carefully controlled so that they are separated by at least 10 kHz.

图 5-3 表示 AM 广播频段的假设部分。无线电台 #4 的中心频率为 640 kHz,与相邻电台的中心频率相隔 10 kHz,如图 5-3 所示。要收听广播电台 #4,我们会将 AM 收音机调到 640 kHz 的频率(或者正如收音机播音员所说的,“欢迎来到收音机表盘上的 640”)。

Figure 5-3 represents a hypothetical portion of the AM broadcast band. Radio Station #4’s center frequency is 640 kHz, separated by 10 kHz from the center frequencies of its neighboring stations as shown in Figure 5-3. To listen to Radio Station #4, we would tune our AM radio to a frequency of 640 kHz (or as the radio announcer would say, “Welcome to 640 on your radio dial”).

Image

图 5-3AM 无线电广播频段的一部分的频谱。

Figure 5-3 Spectrum of a portion of the AM radio broadcast band.

第 2 章中,我们指出 AM 无线电音频信号的带宽限制为 5 kHz。这是真的;然而,调幅 (AM) 过程的固有行为是必要的,以便可以使用传输天线传输信号,它将音频信号的带宽加倍,因此辐射(广播)信号的带宽为 10 kHz,如图 5-3 所示。

In Chapter 2, we stated that the bandwidth of AM radio audio signals is restricted to 5 kHz. That’s true; however, the inherent behavior of the amplitude modulation (AM) process, necessary so that signals can be transmitted using transmission antennas, doubles that audio signal’s bandwidth such that the radiated (broadcasted) signal has a bandwidth of 10 kHz as we see in Figure 5-3.

5 kHz 音频带宽限制至关重要,因为如果无线电台 #4 发生设备故障,并且音频带宽无意中为 8 kHz,则辐射信号的带宽将为 16 kHz,如图 5-4 所示。这种情况将导致 Radio Station #4 的辐射信号干扰邻近的无线电台。结果是,如果您将 AM 收音机调到广播电台 #3 或广播电台 #5,您会在所需电台音频信号的背景中听到来自广播电台 #4 的一些高频音频。无线电台工程师确保这种情况永远不会发生。

That 5 kHz audio bandwidth restriction is critical because if an equipment malfunction occurred at Radio Station #4 and the audio bandwidth was inadvertently 8 kHz, the radiated signal’s bandwidth would be 16 kHz as shown in Figure 5-4. That situation would cause Radio Station #4’s radiated signal to interfere with neighboring radio stations. The result would be that if you tuned your AM radio to Radio Station #3 or Radio Station #5, you’d hear some of the high-frequency audio from Radio Station #4 in the background of your desired station’s audio signal. Radio station engineers ensure this scenario never occurs.

Image

图 5-4当无线电台 #4 的传输信号带宽超过 10 kHz 时,AM 无线电干扰。

Figure 5-4 AM radio interference when Radio Station #4’s transmitted signal bandwidth exceeds 10 kHz.


顺便一提

By the Way

无线电传输中心频率和带宽的分配多年来一直是一个热门话题。在美国,联邦通信委员会 (FCC) 使用听证会、拍卖甚至彩票来分配这种有限而宝贵的资源。这与 1800 年代早期的通信相去甚远,当时摩尔斯电码信号是使用火花隙发射器发送的,该发射器辐射频率非常宽且不可预测。

The allocation of radio transmission center frequency and bandwidth has been a hot topic for many years. In the United States, the Federal Communication Commission (FCC) uses hearings, auctions, and even lotteries to allocate this finite and valuable resource. This is a far cry from the early days of communications in the 1800s when Morse code signals were sent using a spark-gap transmitter that radiated over very wide and unpredictable frequencies.


AM 无线电台发射的信号中心频率必须正好相隔 10 kHz 的限制也很关键。假设无线电台 #4 发生发射机设备故障,其辐射信号的中心频率无意中变为 643 kHz,如图 5-5 所示。这种情况将导致 Radio Station #4 的无线电信号干扰 Radio Station #5。为了防止一个无线电台的信号侵入另一个无线电台的信号,AM 无线电台工程师的任务是确保图 5-4图 5-5 中的场景永远不会发生。(附录 C 提供了有关 AM 无线电信号的其他信息。

The restriction that an AM radio station’s transmitted signal center frequencies must be separated by exactly 10 kHz is also critical. Let’s say a transmitter equipment malfunction occurred at Radio Station #4 and its radiated signal’s center frequency was inadvertently 643 kHz as shown in Figure 5-5. That situation would cause Radio Station #4’s radio signal to interfere with Radio Station #5. To prevent one radio station’s signal from encroaching on another station’s signal, AM radio station engineers are tasked to see that the scenarios in Figure 5-4 and Figure 5-5 never occur. (Appendix C provides additional information concerning AM radio signals.)

Image

图 5-5当无线电台 #4 以错误的中心频率发射时,AM 无线电干扰。

Figure 5-5 AM radio interference when Radio Station #4 transmits at the wrong center frequency.

上面讨论的目的是说明为什么我们如此关心信号谱。在信号处理的实际世界中,控制和测量信号频谱的重要性怎么强调都不为过。说了这么多,现在让我们看看数字信号的频谱。

The purpose of the discussion above is to show why we care so much about signal spectra. We cannot overemphasize the importance of controlling and measuring signal spectra in the practical world of signal processing. Having said that, let’s now look at the spectra of digital signals.

采样如何影响数字信号的频谱

How Sampling Affects the Spectra of Digital Signals

当我们将模拟信号转换为数字信号时,数字信号的频谱取决于两件事:(1) 模拟信号的频谱和 (2) 模数转换过程的 fs 采样率。本节将解释这种双重依赖性。

When we convert an analog signal to a digital signal, the spectrum of the digital signal depends on two things: (1) the spectrum of the analog signal and (2) the fs sample rate of the analog-to-digital conversion process. This section explains that two-fold dependence.

绝大多数数字信号是由我们在上一章中介绍的周期性采样过程产生的。该过程如图 5-6 所示。我们以前见过该图中的图表。模拟信号被施加到模数转换器上,其采样率为每秒 fs 样本数(通常称为 fs Hz),产生我们的数字信号,即一系列离散数字。

The vast majority of digital signals are generated by the periodic sampling process that we introduced in the last chapter. That process is shown in in Figure 5-6. We’ve seen the diagram in that figure before. An analog signal is applied to an analog-to-digital converter, whose sample rate is fs samples per second (commonly referred to as fs Hz), producing our digital signal, a sequence of discrete numbers.

Image

图 5-6通过对模拟信号进行采样来生成数字信号(数字 n1、n2、n3 等的序列)。

Figure 5-6 Generating a digital signal (the sequence of numbers n1, n2, n3, . . .) by sampling an analog signal.

我们在这个采样过程中的目标是生成一个数字信号,其中包括 input 模拟信号中包含的所有信息。例如,如果模拟输入信号是音乐信号,我们可能希望将数字信号的样本(数字)组合成一个数据文件,并将该文件附加到电子邮件中,然后发送给朋友。使用她家用计算机上的适当软件,我们的朋友可以使用数字信号数据文件来再现原始模拟音乐信号,并在她计算机的扬声器上收听。

Our goal in this sampling process is to generate a digital signal that includes all of the information contained in the input analog signal. For example, if the analog input signal is a music signal, we may want to assemble the digital signal’s samples (numbers) into a data file and attach that file to an e-mail and send it to a friend. Using the appropriate software on her home computer, our friend can use the digital signal data file to reproduce the original analog music signal and listen to it on her computer’s loudspeakers.

再次考虑频谱的概念,采样过程输入端的模拟电压信号将具有一些固定的频谱。例如,如果模拟信号是麦克风的输出,则该信号可能具有如图 5-7 所示的频谱。

Thinking again about the notion of spectra, the analog voltage signal at the input of our sampling process will have some fixed spectrum. For example, if the analog signal is the output of a microphone, the signal may have a spectrum like that depicted in Figure 5-7.

Image

图 5-7麦克风模拟输出电压的典型频谱。

Figure 5-7 A typical spectrum of the analog output voltage of a microphone.

图 5-6 中周期性采样过程令人惊讶的是,数字信号的数字序列的频谱不仅取决于模拟输入信号的频谱,而且数字信号的频谱还取决于 fs 采样率的频率!乍一看,这种依赖性似乎不太重要,但确实如此。如果图 5-6 中的模拟输入信号具有图 5-7 所示的频谱,那么我们希望数字信号具有相同的频谱。在这种情况下,数字信号包含模拟信号中存在的所有信息,未失真。但是,如果图 5-6 中的时钟脉冲选择了错误的 fs 频率,则数字信号的频谱将与模拟信号的频谱不同。发生这种情况时,数字信号是输入模拟信号的损坏版本。

The surprising thing about the periodic sampling process in Figure 5-6 is that the spectrum of the digital signal’s sequence of numbers not only depends on the spectrum of the analog input signal, but the spectrum of the digital signal also depends on the frequency of the fs sample rate! At first glance, that dependence may not seem too important, but indeed it is. If the analog input signal in Figure 5-6 has the spectrum shown in Figure 5-7, then we want the digital signal to have that same spectrum. In that case, the digital signal contains all the information, undistorted, that existed in the analog signal. However, it’s possible that, with an incorrectly chosen fs frequency for our clock pulses in Figure 5-6, the digital signal’s spectrum will not be the same as the analog signal’s spectrum. When that happens, the digital signal is a corrupted version of the input analog signal.

我们在这里要说的是,如果 fs 采样率不正确,将模拟音乐信号转换为数字信号并通过电子邮件发送给朋友,在朋友的计算机扬声器上听起来就像难以理解的音频乱码。因此,在关于采样率选择不当的警告之后,现在让我们仔细看看哪些情况会导致意外的、可能有害的数字信号频谱问题。

What we’re saying here is that with an improper fs sample rate, an analog music signal converted to a digital signal and e-mailed to a friend would sound like unintelligible audio garble on the friend’s computer loudspeakers. So, following that warning with regard to poorly chosen fs sample rates, let’s now take a closer look at what situations can cause unexpected, and possibly detrimental, digital signal spectral problems.

对振荡量进行采样的恶作剧

The Mischief in Sampling Oscillating Quantities

在我们研究采样模拟信号的频谱效应之前,我们将进行另一个思想实验。

Before we examine the spectral effects of sampling analog signals, we’ll engage in another thought experiment.

假设我们有一个机械钟,它有秒针但没有分针或时针。秒针每 60 秒旋转 360 度。接下来,假设我们在中午 12:00 指向秒针时拍摄时钟的照片,然后每 55 秒拍摄一次额外的照片。我们的前四张照片将如图 5-8(a)图 5-8(d) 中的照片所示。我们可以将这些照片视为时钟秒针平稳、连续旋转运动的样本

Suppose we have a mechanical clock that has a second hand but no minute or hour hand. The second hand makes a full 360 degree rotation every 60 seconds. Next, suppose we take a photograph of the clock when the second hand is pointed at 12:00 noon and then take additional photos every 55 seconds. Our first four photographs would look like those in Figure 5-8(a) through Figure 5-8(d). We can think of those photographs as samples of the smooth, continuous rotary motion of the clock’s second hand.

Image

图 5-8时钟旋转秒针的周期性照片,每 55 秒一张照片。

Figure 5-8 Periodic photos, one photo every 55 seconds, of a clock’s rotating second hand.

当向某人展示图 5-8 中按时间排序的照片时,随着时间的推移,他或她会如何看待秒针的运动方向?没错;从照片中可以看出,秒针似乎正在逆时针方向旋转!现在,如果我们更频繁地拍摄照片,比如每 5 秒一次,则按时间排序的照片将如图 5-9(a)图 5-9(d) 所示。在该图中,照片序列正确地显示秒针正沿顺时针方向旋转。

Upon showing those time-ordered photos in Figure 5-8 to someone, what would he or she think about the direction of motion of the second hand as time advances? That’s right; from the photos, it appears that the second hand is rotating in the counterclockwise direction! Now, if we took our photographs much more often, say once every 5 seconds, the time-ordered photos would look like those in Figure 5-9(a) through Figure 5-9(d). And in that figure, the sequence of photos correctly shows that the second hand is rotating in the clockwise direction.

Image

图 5-9时钟旋转秒针的周期性照片,每 5 秒一张照片。

Figure 5-9 Periodic photos, one photo every 5 seconds, of a clock’s rotating second hand.

我们从思想实验中学到的是,对时钟连续旋转的秒针采样太慢(每 55 秒一张照片)会产生误导性的结果。同样,足够频繁地对旋转秒针进行采样(每 5 秒一张照片)会产生正确的结果。对时钟秒针照片的进一步实验表明,这些词通常意味着,如果我们拍摄照片的频率超过每 30 秒一次,照片序列将显示秒针的正确顺时针运动。(如果我们正好以 30 秒的间隔拍摄照片,指针会在时钟的顶部和底部之间交替,我们无法判断它的旋转方向。

What we learn from our thought experiment is that sampling the clock’s continuously rotating second hand too slowly (one photo every 55 seconds) yields misleading results. Likewise, sampling the rotating second hand sufficiently often (one photo every 5 seconds) produces correct results. Further experimentation with photographs of our clock’s second hand shows us that the words sufficiently often mean that if we take photos more often than every 30 seconds, the sequence of photos would show the correct clockwise motion of the second hand. (If we took the photos exactly at 30-second intervals, the hand would alternate between the top and bottom of the clock, and we could not tell its direction of rotation.)

因此,从这个简单的思想实验中,我们可以陈述所有数字信号处理中最重要的原则之一。那是:

So, from this simple thought experiment we can state one of the most important principles in all of digital signal processing. That is:

要使用一系列样本正确表示其循环周期持续时间为 t 秒的连续(模拟)周期现象,样本之间的时间必须小于 t 的一半。对于我们的 clock,t 是 60 秒,因此我们必须以小于 30 秒的间隔进行采样。

To correctly represent a continuous (analog) periodic phenomenon whose cyclic period duration is t seconds with a sequence of samples, the time between samples must be less than half of t. For our clock, t is 60 seconds, so we must sample at intervals of less than 30 seconds.

换言:

Stated differently:

要正确表示频率为每秒 f 个周期的连续(模拟)周期现象和一系列样本,fs 采样率必须大于 f 的两倍。

To correctly represent a continuous (analog) periodic phenomenon whose frequency is f cycles per second with a sequence of samples, the fs sample rate must be greater than two times f.

最后这句话可能看起来不是很深刻,但肯定是。这种采样率限制基本上渗透到数字信号处理的方方面面。

That last statement may not seem terribly profound, but it most certainly is. This sample rate restriction pervades essentially every aspect of digital signal processing.


顺便一提

By the Way

您之前在图 5-8 中看到过逆时针旋转错觉。回想一下,在老西部电影中,马车的车轮有时似乎是向后旋转的。之所以产生这种错觉,是因为电影摄像机正在拍摄一系列快照,即每秒 24 次的新快照。旋转轮的辐条的行为与图 5-8 中时钟的秒针完全相同。根据马车轮的转速(以每秒转数为单位),与马车的前进速度相比,它的辐条可能看起来旋转得太慢了。在某些情况下,辐条甚至似乎向后旋转,如图 5-8 所示。

You’ve seen that counterclockwise rotation illusion in Figure 5-8 before. In the old Western movies, recall that a wagon’s wheels sometimes appeared to rotate backward. That illusion occurred because the movie camera was taking a sequence of snapshots—a new snapshot 24 times per second. The spokes of a rotating wheel behave exactly like the clock’s second hand in our Figure 5-8 presentation. Depending on the rotation rate of the wagon wheel (in revolutions per second), its spokes may have appeared to be spinning far too slowly compared to the forward speed of the wagon. And in some case, the spokes even appeared to be rotating backward, the effect we saw in Figure 5-8.

您手机的摄像机每秒拍摄 20 到 30 张照片。您可以尝试录制旋转电风扇的手机视频,并在录制视频时关闭风扇。观看完成的视频后,风扇叶片会向后旋转片刻。

Your cell phone’s video camera takes 20 to 30 pictures per second. You might try recording a cell phone video of a spinning electric fan, and turn the fan off while recording your video. Upon viewing your finished video, for a few moments the fan blades will appear to spin backward.


接下来,我们将上面讨论的采样率限制与模拟正弦波电压采样过程联系起来,以寻求理解数字信号的频谱。

Next, we relate the sample rate restriction discussed above to the process of sampling an analog sine wave voltage in our quest to understand the spectra of digital signals.

模拟正弦波电压采样

Sampling Analog Sine Wave Voltages

在上一节中,我们介绍了这样一个概念,即要用样本正确表示平滑变化的量(时钟秒针的位置)的行为,我们必须以足够高的采样率捕获这些样本(拍摄秒针的照片)。现在让我们将这个想法与一个简单的模拟正弦波电压信号进行采样联系起来。一旦我们了解了对正弦波信号进行采样的行为,我们就能够理解更复杂的采样示例,例如对音乐光盘 (CD) 上的音频信号进行采样。

In the last section, we introduced the notion that to correctly represent the behavior of a smoothly changing quantity (the position of a clock’s second hand) with samples, we must capture those samples (take photos of the second hand) at a sufficiently high sample rate. Let’s now relate that idea to sampling a simple analog sine wave voltage signal. Once we understand the behavior of sampling a sine wave signal, we’ll be able to understand more complicated examples of sampling, like the sampling of an audio signal on a music compact disc (CD).

模拟正弦波的正确采样

模拟正弦波电压信号采样的过程如图 5-10 所示。模拟正弦波电压通过两线电缆连接到模数转换器硬件的输入端。转换器的输出是一个数字信号(一串数字),通过多线电缆路由到计算机的内存。由于此过程的采样率为 1,000 Hz,因此每秒有 1,000 个数字传输到计算机。使用计算机软件,我们可以检查和显示数字信号样本的值。

The process of sampling an analog sine wave voltage signal is depicted in Figure 5-10. An analog sine wave voltage is connected, by way of a two-wire cable, to the input of the analog-to-digital converter hardware. The output of the converter is a digital signal (a sequence of numbers) that is routed, by way of a multiwire cable, to a computer’s memory. Because the sample rate of this process is 1,000 Hz, 1,000 numbers per second are transferred to the computer. Using computer software, we can examine and display the values of our digital signal’s samples.

Image

图 5-10对模拟正弦波电压信号进行采样。fs 采样率为 1,000 Hz。

Figure 5-10 Sampling an analog sine wave voltage signal. The fs sample rate is 1,000 Hz.

当输入模拟正弦波电压的频率为 200 Hz 时,模拟正弦波由图 5-11(a) 中的实线表示,点代表模数转换器产生并存储在计算机内存中的离散数。

When the input analog sine wave voltage’s frequency is 200 Hz, the analog sine wave is shown by the solid curve in Figure 5-11(a) and the dots represent the discrete numbers produced by the analog-to-digital converter and stored in the computer’s memory.

Image

图 5-11当 fs 采样率为 1,000 Hz 时,对模拟正弦波电压信号进行采样:(a) 对 200 Hz 正弦波进行采样;(b) 前 6 个样本值。

Figure 5-11 Sampling an analog sine wave voltage signal when the fs sample rate is 1,000 Hz: (a) sampling a 200 Hz sine wave; (b) the first six sample values.

如果我们放大数字信号的前六个样本,我们会看到图 5-11(b) 中的这些样本值。为了便于参考,我们在图 5-11(b) 中包含了虚线正弦波曲线。这里真的没有什么新鲜事。这只是对模拟正弦波电压进行采样的过程,我们在上一章中首次了解了这个过程。

If we zoom in on the first six samples of our digital signal, we see those sample values in Figure 5-11(b). For reference purposes, we include the dotted sine wave curve in Figure 5-11(b). There’s really nothing new here. This is merely the process of sampling an analog sine wave voltage, a process we first learned about in the last chapter.

我们已经正确地对图 5-11 的模拟正弦波进行了采样,因为我们的 1,000 Hz 采样率是 200 Hz 正弦波频率的两倍多。我们为模拟正弦波的每个完整周期生成了两个以上的离散样本。为了更全面,我们在表 5.1 中列出了数字信号的前 6 个样本。

We have correctly sampled Figure 5-11’s analog sine wave because our 1,000 Hz sample rate was greater than two times the frequency of the 200 Hz sine wave. We generated more than two discrete samples for each complete cycle of the analog sine wave. To be thorough, we list the first six samples of our digital signal in Table 5.1.

Image

表 5.1200 Hz 数字信号的前 6 个值

Table 5.1 First Six Values of the 200 Hz Digital Signal

模拟正弦波采样不正确

让我们稍微实验一下:如果我们将输入模拟正弦波电压的频率从 200 Hz 更改为 800 Hz,则数字信号的前六个样本将是图 5-12(a) 中所示的点。而且,如果我们将输入模拟正弦波的频率从 800 Hz 更改为 1,200 Hz,则数字信号的前六个样本将是图 5-12(b) 中所示的点。接下来,请仔细查看图 5-11(b)、5-12(a)5-12(b)。你看到什么有趣的东西吗?

Let’s experiment a little: If we change the frequency of our input analog sine wave voltage from 200 Hz to 800 Hz, the first six samples of our digital signal would be the dots shown in Figure 5-12(a). And, if we change the frequency of the input analog sine wave from 800 Hz to 1,200 Hz, the first six samples of our digital signal would be the dots shown in Figure 5-12(b). Next, look very carefully at Figures 5-11(b), 5-12(a), and 5-12(b). Do you see anything interesting?

Image

图 5-12不同频率的正弦波信号采样: (a) 对 800 Hz 的正弦波进行采样;(b) 对 1,200 Hz 正弦波进行采样。

Figure 5-12 Sampling sine wave signals of different frequencies: (a) sampling an 800 Hz sine wave; (b) sampling a 1,200 Hz sine wave.

没错;这些数字中的三个数字信号(三组点)是相同的!我们通过在相当繁忙的图 5-13 中绘制 200 Hz、800 Hz 和 1,200 Hz 正弦波及其数字表示来验证这一令人震惊的情况。仅从离散样本值来看,我们无法确定原始正弦波的频率。这种情况可以说是处理采样数据最令人惊讶的后果。

That’s right; the three digital signals (the three sets of dots) in those figures are identical! We verify this astounding situation by plotting the 200 Hz, 800 Hz, and 1,200 Hz sine waves and their digital representations in the rather busy Figure 5-13. From the discrete sample values alone, we cannot determine the original sine wave’s frequency. This situation is arguably the most astonishing consequence of dealing with sampled data.

Image

图 5-13当 fs 采样率为 1,000 Hz 时,对 200 Hz、800 Hz 和 1,200 Hz 正弦波进行采样。

Figure 5-13 Sampling 200 Hz, 800 Hz, and 1,200 Hz sine waves when the fs sample rate is 1,000 Hz.

通过对高频模拟正弦波进行采样而获得的数字信号具有数字低频正弦波的身份的情况称为混叠。正如犯罪分子可能会采用新的身份和新名称(别名)来伪装成他们不是的人一样,800 Hz 和 1,200 Hz 数字正弦波信号看起来与采样的 200 Hz 数字信号相同。发生这种情况是因为我们没有正确采样 800 和 1,200 Hz 模拟正弦波。我们没有为这些高频模拟正弦波的每个完整周期生成超过两个离散样本。

The situation where a digital signal obtained from sampling a high-frequency analog sine wave takes on the identity of a digital low-frequency sine wave is called aliasing. Just as criminals may take on a new identity and a new name (an alias) to appear to be someone they are not, the 800 and 1,200 Hz digital sine wave signals appear identical to the sampled 200 Hz digital signal. This happens because we have not correctly sampled the 800 and 1,200 Hz analog sine waves. We did not generate more than two discrete samples for each complete cycle of those higher-frequency analog sine waves.

图 5-14 显示了 800 和 1,200 模拟正弦波的错误采样。在图中,粗体曲线显示了两个模拟正弦波的完整周期,其中在这些单独的周期中只产生一个离散样本。

Figure 5-14 shows the incorrect sampling of the 800 and 1,200 analog sine waves. In the figure, the bold curves show complete cycles of the two analog sine waves where only one discrete sample is generated during those individual cycles.

Image

图 5-14不正确的采样显示一个完整的模拟周期由少于两个样本表示:(a) 800 Hz 的正弦波;(b) 1,200 Hz 的正弦波。

Figure 5-14 Incorrect sampling showing where a complete analog cycle is represented by less than two samples: (a) an 800 Hz sine wave; (b) a 1,200 Hz sine wave.

同样,这里的重点是:仅从我们的数字信号(表 5.1 中列出的样本值)来看,我们无法判断该数字信号是通过对 200、800 或 1,200 Hz 模拟正弦波进行采样获得的。

Again, the point here is: from our digital signal alone (the sample values listed in Table 5.1), we cannot tell if that digital signal was obtained from sampling a 200, 800, or 1,200 Hz analog sine wave.

为什么我们关心 Aliasing

Why We Care about Aliasing

数字信号可以是具有不同频率的多个正弦波的采样表示,我们称之为混叠,这在数字信号处理领域至关重要。我们可以通过一个例子轻松证明这种重要性。

The situation where a digital signal can be the sampled representation of multiple sine waves having different frequencies, what we call aliasing, is of critical importance in the field of digital signal processing. We can easily demonstrate this importance with an example.

在本章的前面,我们提到了将模拟音乐信号转换为数字信号的概念,将数字信号的数值样本组装成一个数据文件,然后通过电子邮件将该文件发送给朋友。使用适当的软件和家用计算机上的内置数模转换器,这位朋友可以将数字信号文件转换为模拟音乐信号,并在她计算机的扬声器上收听。

Earlier in this chapter, we mentioned the notion of converting an analog music signal into a digital signal, assembling the digital signal’s numerical samples into a data file, and e-mailing that file to a friend. Using appropriate software and the built-in digital-to-analog converter on her home computer, the friend can convert the digital signal file to an analog music signal and listen to it on her computer’s loudspeaker.

但是,对图 5-13 中的数字信号执行此操作可能会导致问题,如图 5-15 所示。如果电子邮件中的数字信号是采样的 200 Hz 音频音调(以 1,000 Hz 的速率采样),则我们的朋友会从她计算机的扬声器中听到 200 Hz 的音调,如图 5-15(a) 所示。事情本来就是应该的。

However, doing this with the digital signal in Figure 5-13 can lead to problems as we show in Figure 5-15. If the e-mailed digital signal was a sampled 200 Hz audio tone (sampled at a rate of 1,000 Hz), our friend would hear a 200 Hz tone from her computer’s speakers as shown in Figure 5-15(a). Things are as they should be.

Image

图 5-15从采样率为 1,000 Hz 的数字信号再现模拟音频正弦波:(a) 原始模拟正弦波为 200 Hz;(b) 原始模拟正弦波是混叠频率 800 Hz;(c) 原始正弦波是混叠频率 1,200 Hz。

Figure 5-15 Reproducing an analog audio sine wave from a digital signal whose sample rate is 1,000 Hz: (a) original analog sine wave is 200 Hz; (b) original analog sine wave is the alias frequency 800 Hz; (c) original sine wave is the alias frequency 1,200 Hz.

另一方面,如果原始采样的模拟信号是如图 5-15(b) 所示的 800 Hz 音频正弦波,我们的朋友仍然会听到再现的模拟正弦波是 200 Hz 的音频音调!同样,如果原始采样的模拟信号是如图 5-15(c) 所示的 1,200 Hz 音频正弦波,我们的朋友会再次听到再现的模拟正弦波是 200 Hz 的音频音调。图 5-15 中的场景不应该让我们感到惊讶。这是因为所有三封电子邮件中的数字信号都是相同的。

On the other hand, if the original sampled analog signal were an 800 Hz audio sine wave as shown in Figure 5-15(b), our friend would still hear the reproduced analog sine wave as being a 200 Hz audio tone! Likewise, if the original sampled analog signal were a 1,200 Hz audio sine wave as shown in Figure 5-15(c), our friend would again hear the reproduced analog sine wave as being a 200 Hz audio tone. The scenarios in Figure 5-15 should not surprise us. That’s because the digital signals in all three e-mails are identical.

现在我们知道为什么 800 和 1,200 Hz 正弦波被称为 200 Hz 正弦波的别名模数转换后,这两个原本高频的正弦波都会显示为低频 200 Hz 的正弦波。这就是混叠。

Now we know why 800 and 1,200 Hz sine waves are called aliases of a 200 Hz sine wave. After analog-to-digital conversion, both of these originally high-frequency sine waves will appear to be a low-frequency 200 Hz sine wave. That’s aliasing.

事实证明,我们可以用数字样本正确表示的最高频率模拟正弦波是频率不超过采样率一半的正弦波。在上面的示例中,我们可以通过电子邮件发送给朋友的最高频率正确采样的数字信号正弦波是频率为 1,000/2 = 500 Hz 的正弦波。所以,我们回到了本章前面提到的关于拍摄时钟旋转秒针照片的话题。那是

As it turns out, the highest frequency analog sine wave that we can correctly represent with digital samples is a sine wave whose frequency is no greater than half the sample rate. In our example above, the highest-frequency correctly sampled digital signal sine wave we can e-mail to our friend is a sine wave whose frequency is 1,000/2 = 500 Hz. So here we are, back to the topic we touched upon earlier in this chapter regarding taking photos of the rotating second hand of a clock. That is,

要使用一系列样本正确表示最高频率成分为 f 个每秒周期 (Hz) 的连续(模拟)现象,fs 采样率必须大于 f 的两倍。

To correctly represent a continuous (analog) phenomenon whose highest frequency content is f cycles per second (Hz) with a sequence of samples, the fs sample rate must be greater than two times f.

在数字信号处理领域,此采样率限制称为奈奎斯特采样标准。正如我们在第 3 章中讨论的那样,以 fs = 8,000 Hz 的采样率将所有电话呼叫作为数字信号传输的现代电话系统必须过滤所有模拟音频语音信号,以便它们不包含超过 8,000/2 = 4,000 Hz 的模拟能量。

In the field of digital signal processing, this sample rate restriction is called the Nyquist sampling criterion. This constraint is why modern telephone systems that transmit all phone calls as digital signals at a sample rate of fs = 8,000 Hz must filter all analog audio voice signals so that they contain no analog energy above 8,000/2 = 4,000 Hz, as we discussed in Chapter 3.

数字正弦波信号的频谱

The Spectrum of a Digital Sine Wave Signal

现在我们准备好回答这个问题,“数字信号的频谱是多少?我们用一个例子来回答这个问题。假设我们以 1,000 Hz 的 fs 采样率对 200 Hz 模拟正弦波进行采样,如图 5-16(a) 所示。图 5-16(b) 仅显示数字信号样本。接下来,我们将样本编译成一个文件,并通过电子邮件将文件发送给数字信号处理工程师。我们告诉工程师,我们对模拟正弦波进行了采样,数字信号的采样率为 fs = 1,000 Hz。注意不要告诉工程师原始模拟信号的频率,接下来我们要求工程师确定数字信号的频谱。

Now we’re ready to answer the question, “What is the spectrum of a digital signal?” We answer that question with an example. Let’s say we sampled a 200 Hz analog sine wave at an fs sample rate of 1,000 Hz as shown in Figure 5-16(a). Figure 5-16(b) shows only the digital signal samples. Next, we compile the samples into a file and e-mail the file to a digital signal processing engineer. We tell the engineer that we sampled an analog sine wave and the digital signal’s sample rate is fs = 1,000 Hz. Being careful not to tell the engineer the original analog signal’s frequency, next we ask the engineer to determine the spectrum of the digital signal.

Image

图 5-16以 1,000 Hz 的 fs 采样率对 200 Hz 正弦波进行采样:(a) 原始模拟正弦波(虚线)和数字信号样本;(b) 仅数字信号样本。

Figure 5-16 Sampling a 200 Hz sine wave at an fs sample rate of 1,000 Hz: (a) original analog sine wave (dashed curve) and digital signal samples; (b) digital signal samples only.

工程师可以对数字信号样本执行数学运算,并确定信号的频率为采样率的五分之一;即 1,000/5 = 200 Hz。然后,工程师可以声明产生数字信号的采样模拟信号是 200 Hz 模拟正弦波。

The engineer can perform a mathematical operation on the digital signal samples and determine that the signal has a frequency of one-fifth of the sample rate; that is 1,000/5 = 200 Hz. The engineer can then state that the sampled analog signal that produced the digital signal was a 200 Hz analog sine wave.

但是,根据我们在上一节中介绍的混叠概念和 1,000 Hz 的 fs 采样率,工程师还知道原始模拟信号也可能是 800、1,200、1,800 或 2,200 等 Hz 模拟正弦波。由于模拟信号采样过程固有的频率混叠行为,工程师面临着一个基本的歧义,即为产生数字信号而采样的原始模拟信号的频率是多少。

But, based on the concept of aliasing we presented in the last section, and an fs sample rate of 1,000 Hz, the engineer also knows that the original analog signal could also have been an 800, 1,200, 1,800, or 2,200, etc., Hz analog sine wave. Because of the inherent frequency-aliasing behavior of the process of sampling analog signals, the engineer is faced with a fundamental ambiguity of just what was the frequency of the original analog signal that was sampled to produce the digital signal.

鉴于这种众所周知的频率模糊性,数字信号处理先驱们在几十年前就决定,显示图 5-16(b) 数字信号频谱的最现实方法是图 5-17 中的图表。给定数字信号采样值和 fs = 1,000 Hz 采样率,分析数字信号的工程师别无选择,只能创建图 5-17 图形描述,其中包含永无止境的频谱复制。现在你明白为什么我们在本章前面写了:

Given this well-known frequency ambiguity, digital signal processing pioneers decided decades ago that the most realistic way to show the spectrum of the Figure 5-16(b) digital signal is the diagram in Figure 5-17. Given the digital signal sample values and the fs = 1,000 Hz sample rate, the engineer analyzing the digital signal has no choice but to create the Figure 5-17 graphical description, with its never-ending spectral replications. Now you understand why earlier in this chapter we wrote:

Image

图 5-17图 5-16(b) 中的数字信号频谱。

Figure 5-17 The spectrum of the digital signal in Figure 5-16(b).

当我们将模拟信号转换为数字信号时,数字信号的频谱取决于两件事:(1) 模拟信号的频谱和 (2) 模数转换过程的 fs 采样率。

When we convert an analog signal to a digital signal, the spectrum of the digital signal depends on two things: (1) the spectrum of the analog signal and (2) the fs sample rate of the analog-to-digital conversion process.

但是,假设我们向工程师发送了第二封电子邮件,指出:“顺便说一句,我们正确地对模拟正弦波进行了采样。也就是说,1000 Hz 采样率是模拟正弦波频率的两倍多。此时,工程师可以消除所有频率模糊性。他现在知道模拟正弦波信号的频率小于 fs/2 = 500 Hz,图 5-17 中数字信号频谱中唯一小于 500 Hz 的频谱分量是 200 Hz。因此,采样的模拟正弦波的频率为 200 Hz,允许工程师以图形方式描述数字信号的频谱,如图 5-18 所示。

However, let’s say we sent a second e-mail to the engineer stating, “By the way, we correctly sampled our analog sine wave. That is, the 1,000 Hz sample rate was greater than twice the frequency of the analog sine wave.” At that point, all frequency ambiguity is eliminated for the engineer. He now knows that the analog sine wave signal’s frequency was less than fs/2 = 500 Hz, and the only spectral component of the digital signal spectrum in Figure 5-17 that is less than 500 Hz is 200 Hz. Therefore, the sampled analog sine wave had a frequency of 200 Hz, allowing the engineer to graphically describe the spectrum of the digital signal as shown in Figure 5-18.

Image

图 5-18图 5-16(b) 中数字信号的明确频谱。

Figure 5-18 The unambiguous spectrum of the digital signal in Figure 5-16(b).

这里的重点是,图 5-16(b) 数字正弦波信号的频谱可以用图 5-17图 5-18 来描述。这两个数字都是正确的,它们包含相同数量的信息,并且,如果给定其中一个数字,我们可以绘制另一个数字。

The point here is that the spectrum of the Figure 5-16(b) digital sine wave signal can be described by either Figure 5-17 or Figure 5-18. Both of these figures are correct, they contain the same amount of information, and, if given one of the figures, we could draw the other figure.

数字语音信号的频谱

The Spectrum of a Digital Voice Signal

为了增强我们对数字信号频谱的理解,让我们看看比简单的正弦波更复杂的数字信号频谱。

To enhance our understanding of the spectra of digital signals, let’s look at the spectrum of a digital signal that’s more complicated than a simple sine wave.

第 3 章中,我们介绍了一个模拟语音信号,其频谱如图 5-19(a) 所示。如果我们将该模拟语音信号应用于采样率为 fs = 8,000 Hz 的模数转换器,则数字信号的频谱如图 5-19(b) 所示。

In Chapter 3, we presented an analog voice signal whose spectrum is that shown in Figure 5-19(a). If we apply that analog voice signal to an analog-to-digital converter, whose sample rate was fs = 8,000 Hz, the spectrum of the digital signal is shown in Figure 5-19(b).

Image

图 5-19电话语音信号: (a) 原始模拟信号频谱;(b) 显示频谱复制的数字信号频谱;(c) 数字信号频谱的替代描述。

Figure 5-19 Telephone voice signal: (a) original analog signal spectrum; (b) digital signal spectrum showing spectral replications; (c) alternate depiction of the digital signal spectrum.

因为我们知道 fs = 8,000 采样率是原始模拟语音信号最高频率频谱分量的两倍,所以图 5-19(b) 中没有频率歧义(没有重叠的频谱混叠)。根据数字信号的频谱,我们知道原始模拟信号的频谱是图 5-19(b) 左侧所示的频谱。因此,我们的数字信号的频谱也可以绘制,具有相同的有效性,如图 5-19(c) 所示。同样,图 5-19(b)图 5-19(c) 都是对数字信号频谱的正确和等效描述。

Because we know the fs = 8,000 sample rate is greater than twice the highest-frequency spectral component of the original analog voice signal, there is no frequency ambiguity (no overlapping spectral aliases) in Figure 5-19(b). Based on the spectrum of the digital signal, we know the spectrum of the original analog signal is that shown on the left side of Figure 5-19(b). As such, our digital signal’s spectrum can also be drawn, with equal validity, as that shown in Figure 5-19(c). Again, both Figure 5-19(b) and Figure 5-19(c) are correct and equivalent depictions of the digital signal’s spectrum.

关于数字语音信号这个主题的关键点是,电话公司将数字信号(其频谱如图 5-19(b) 所示)从呼叫者所在位置附近的交换站传输到呼叫接收者所在位置附近的交换站。呼叫接收者位置附近的交换站将该数字信号转换回模拟信号,其频谱如图 5-19(c) 所示。然后,重新生成的模拟信号将传输到呼叫接收方的家庭电话。由于呼叫接收方接收到的模拟语音信号频谱与呼叫方最初产生的模拟语音信号频谱相同,如图 5-19(a) 所示,呼叫接收方从其固定电话的扬声器中听到了可理解的声音。

The critical point about this topic of digital voice signals is the fact that the telephone company transmits the digital signal, whose spectrum is shown in Figure 5-19(b), from a switching station near the caller’s location to a switching station near the call recipient’s location. The switching station near the call recipient’s location converts that digital signal back to an analog signal whose spectrum is shown in Figure 5-19(c). The regenerated analog signal is then transmitted to the call recipient’s home telephone. Because the spectrum of the analog voice signal received by the call recipient is the same as the spectrum of the analog voice signal originally produced by the caller, as shown in Figure 5-19(a), the call recipient hears an intelligible voice from the loudspeaker of his landline telephone.

数字音乐信号的频谱

The Spectrum of a Digital Music Signal

让我们考虑带宽大于语音信号的 3.2 kHz 带宽的音频音乐信号。图 5-20(a) 显示了带宽为 6 kHz 的假设模拟音乐信号的频谱。模拟信号的最高频率频谱内容约为 6 kHz。如果我们使用模数转换器以 fs = 8 kHz 的采样率对模拟信号进行采样,则生成的数字信号的频谱将如图 5-20(b) 所示。假设我们已经将数字信号录制到光盘 (CD) 上。

Let’s consider audio music signals whose bandwidths are greater than the 3.2 kHz bandwidth of voice signals. Figure 5-20(a) shows the spectrum of a hypothetical analog music signal having a bandwidth of 6 kHz. The highest-frequency spectral content of the analog signal is roughly 6 kHz. If we used an analog-to-digital converter to sample that analog signal at a sample rate of fs = 8 kHz, the spectrum of the resulting digital signal would be that shown in Figure 5-20(b). Let’s assume we’ve recorded the digital signal on a compact disc (CD).

Image

图 5-20假设模拟音乐信号: (a) 原始音乐信号频谱;(b) 显示重叠频谱复制的数字信号频谱;(c) 来自 CD 的模拟播放信号的受污染频谱。

Figure 5-20 Hypothetical analog music signal: (a) original music signal spectrum; (b) digital signal spectrum showing overlapped spectral replications; (c) contaminated spectrum of the analog playback signal from a CD.

由于 fs = 8 kHz 采样率小于模拟信号最高频率频谱内容的两倍(即小于 12 kHz),因此频谱混叠与原始信号频谱重叠,如图 5-20(b) 左侧的交叉阴影区域所示。在这种情况下,我们违反了奈奎斯特采样准则,这会导致数字信号的低频频谱受到污染。因此,如果我们将光盘放入 CD 播放器中听音乐,我们听到的音频信号将具有图 5-20(c) 所示的频谱。数字信号的重叠频谱分量会导致最终的模拟音频播放信号在水下发出令人不快的声音或咕噜咕噜的声音。

Because the fs = 8 kHz sample rate is less than twice the highest-frequency spectral content of the analog signal (that is, less than 12 kHz), a spectral alias overlaps the original signal spectrum as shown by the cross-hatched area on the left side of Figure 5-20(b). In this scenario, we have violated the Nyquist sampling criterion, which results in a digital signal whose low-frequency spectrum is contaminated. As such, if we put that compact disc in a CD player to listen to the music, the audio signal we hear will have the spectrum shown in Figure 5-20(c). The digital signal’s overlapped spectral components cause the final analog audio playback signal to have an unpleasant underwater, or gurgling, sound.

在 CD 上录制音乐的音频工程师只需增加从原始模拟音乐信号获得的数字信号的 fs 采样率,即可解决上述重叠频谱问题。由于模拟音乐信号的频率几乎高达 20 kHz,如图 5-21(a) 所示,因此音乐 CD 上录制的数字音乐信号的采样率必须大于 40 kHz。出于各种工程原因,音乐光盘的行业标准采样率为 44.1 kHz,如图 5-21(b) 所示。在该图中,我们看到 fs = 44.1 kHz 采样率导致没有频谱重叠,并且 CD 的模拟播放信号将不会失真,如图 5-21(c) 所示。

Audio engineers who record music on CDs solve the overlapped spectrum problem described above by merely increasing the fs sample rate of the digital signal obtained from the original analog music signal. Because analog music signals can have frequencies almost as high as 20 kHz, as shown in Figure 5-21(a), the sample rate of the digital music signals recorded on music CDs must be greater than 40 kHz. For a variety of engineering reasons, the industry standard sample rate for music compact discs is 44.1 kHz as shown in Figure 5-21(b). In that figure, we see that the fs = 44.1 kHz sample rate results in no spectral overlap and the CD’s analog playback signal will be undistorted as shown in Figure 5-21(c).

Image

图 5-21模拟音乐讯号:(a) 原始音乐讯号频谱;(b) 数字信号频谱显示没有重叠的频谱复制;(c) 来自 CD 的模拟播放信号的频谱。

Figure 5-21 Analog music signal: (a) original music signal spectrum; (b) digital signal spectrum showing no overlapped spectral replications; (c) spectrum of the analog playback signal from a CD.

抗锯齿滤镜

Anti-Aliasing Filters

在数字信号处理领域,您可能会遇到 anti-aliasing filter 这个短语。这样的滤波器是一种硬件设备,我们通过一个实际示例来描述它的操作。

In the field of digital signal processing, you’re likely to encounter the phrase anti-aliasing filter. Such a filter is a hardware device, and we describe its operation by way of a practical example.

考虑一个大型交流电源变压器,如图 5-22 所示,它位于餐厅或酒店外墙外的混凝土平台上。如果您曾经站在这样的变压器旁边,您可能还记得它是如何发出低频音频嗡嗡声的——一种像昆虫一样的连续嗡嗡声。变压器内部波动的交流电压产生波动的磁场,导致变压器内的金属板振动。就像扬声器的振动锥产生声音一样,变压器的内部金属板也会振动并产生 120 Hz 的低电平音频嗡嗡声(如果您居住在欧洲,则为 100 Hz)。商用变压器制造商尽最大努力减少变压器的音频嗡嗡声。为此,他们必须首先测量 120 Hz 音频嗡嗡声信号的振幅(响度)。

Think about a large electric AC power transformer, such as that shown in Figure 5-22, sitting on concrete platform just outside the outer wall of a restaurant or hotel. If you’ve ever stood next to such a transformer, you may recall how it emits a low-frequency audio hum—a continuous insect-like buzzing. The fluctuating AC voltage inside the transformer generates a fluctuating magnetic field that causes metal plates within the transformer to vibrate. Just as the vibrating cone of a loudspeaker generates sound, the transformer’s internal metal plates vibrate and produce a low-level 120 Hz audio hum (or 100 Hz if you live in Europe). Commercial transformer manufacturers do their best to minimize their transformers’ audio humming noise. To do so, they must first measure the amplitude (the loudness) of that 120 Hz audio humming signal.

Image

图 5-22交流电源变压器。(来自 Zern Liew/Shutterstock)

Figure 5-22 Electric AC power transformer. (From Zern Liew/Shutterstock)

因此,假设我们的工作是测量大型交流电源变压器附近音频嗡嗡声的振幅。我们的测试设置如图 5-23(a) 所示。在测量 120 Hz 音频信号的幅度时,我们必须通过将模数转换器的 fs 采样率设置为大于 120 Hz 的两倍来满足奈奎斯特采样标准。因此,我们可以自由选择 fs = 300 Hz 的采样率,如图 5-23(a) 所示。

So let’s say it’s our job to measure the amplitude of the audio humming sound in close proximity to a large AC power transformer. Our test setup will be that shown in Figure 5-23(a). In measuring the amplitude of a 120 Hz audio signal, we must satisfy the Nyquist sampling criterion by setting the analog-to-digital converter’s fs sample rate to be greater than two times 120 Hz. So we’re free to choose a sample rate of fs = 300 Hz as shown in Figure 5-23(a).

Image

图 5-23测量交流电源变压器嗡嗡作响的 120 Hz 音频信号:(a) 测试设备设置;(b) 麦克风模拟输出信号的频谱。

Figure 5-23 Measuring an AC power transformer’s humming 120 Hz audio signal: (a) test equipment setup; (b) spectrum of the microphone’s analog output signal.

假设麦克风的模拟音频输出信号的频谱如图 5-23(b) 所示。我们在图的左侧看到低电平 120 Hz 嗡嗡声信号的频谱分量,以及由附近的汽车交通等引起的高频环境音频频谱能量。同样,我们的工作是测量 120 Hz 信号的频谱分量的幅度。

Let’s assume the spectrum of the microphone’s analog audio output signal is as shown in Figure 5-23(b). We see our low-level 120 Hz humming signal’s spectral component on the left side of the figure, as well as higher-frequency ambient audio spectral energy caused, for example, by nearby automobile traffic. Again, our job is to measure the amplitude of the 120 Hz signal’s spectral component.

在计算和显示模数转换器输出信号的频谱时(如图 5-24 所示),我们遇到了一个大问题:由于对模拟信号进行采样的固有行为,麦克风输出信号的高频音频频谱能量在频率上混叠,显示为图 5-24 所示的低频频谱能量.我们要测量的 120 Hz 频谱幅度峰值受到混叠频谱能量的严重污染,并且基本上被掩盖了。

Upon computing and displaying the spectrum of our analog-to-digital converter’s output signal, shown in Figure 5-24, we encounter a big problem: Due to the inherent behavior of sampling our analog signal, the microphone output signal’s high-frequency audio spectral energy aliases down in frequency to appear as the low-frequency spectral energy displayed in Figure 5-24. The 120 Hz spectral amplitude peak value we want to measure is severely contaminated, and essentially obscured, by aliased spectral energy.

Image

图 5-24模数转换器输出信号频谱。

Figure 5-24 Analog-to-digital converter output signal spectrum.

我们问题的解决方案是消除施加到模数转换器的模拟信号中的高频频谱能量,我们使用图 5-25(a) 所示的模拟低通抗混叠滤波器来实现这一点。该模拟滤波器旨在传递低频信号,包括我们所需的 120 Hz 信号,并大大降低 120 Hz 以上的所有频谱能量。因此,施加到模数转换器的模拟信号频谱如图 5-25(b) 所示。

The solution to our problem is to eliminate the high-frequency spectral energy in the analog signal applied to our analog-to-digital converter, and we do so with the analog lowpass anti-aliasing filter shown in Figure 5-25(a). That analog filter is built to pass low-frequency signals, including our desired 120 Hz signal, and drastically reduces all spectral energy above 120 Hz. Thus, the spectrum of the analog signal applied to the analog-to-digital converter is as shown Figure 5-25(b).

Image

图 5-25使用抗混叠滤波器测量 120 Hz 音频信号:(a) 新的测试设备设置;(b) 滤波器模拟输出信号的频谱。

Figure 5-25 Using an anti-aliasing filter to measure a 120 Hz audio signal: (a) new test equipment setup; (b) spectrum of the filter’s analog output signal.

通过采用模拟抗混叠滤波器,图 5-25(b) 中应用于模数转换器的 120 Hz 以上的环境高频频谱能量的振幅非常低。因此,当不需要的高频、低振幅能量在我们的数字信号频谱中混叠时,如图 5-26 所示,它不会抑制我们测量所需 120 Hz 信号的频谱峰值振幅的能力。在这种情况下,必须使用硬件模拟抗锯齿滤波器才能成功。

By employing an analog anti-aliasing filter, the ambient high-frequency spectral energy above 120 Hz in Figure 5-25(b), applied to the analog-to-digital converter, is very low in amplitude. So when that unwanted high-frequency, low-amplitude, energy aliases down in frequency in our digital signal’s spectrum, as shown in Figure 5-26, it does not inhibit our ability to measure the spectral peak amplitude of our desired 120 Hz signal. Using the hardware analog anti-aliasing filter is mandatory for success in this situation.

Image

图 5-26模数转换器输出信号频谱。

Figure 5-26 Analog-to-digital converter output signal spectrum.

模数转换器输出编号

Analog-to-Digital Converter Output Numbers

关于模拟信号采样过程的一个重要主题是模数转换器产生的数字的性质。

An important topic regarding the process of sampling an analog signal is the nature of the numbers produced by an analog-to-digital converter.

当我们对模拟信号进行采样时,如图 5-25(a) 所示,数字信号的数字序列不是我们在日常生活中非常熟悉的十进制数字的形式。数字信号的数字序列 n1、n2、n3 等采用我们所说的二进制数的形式。第 9 章讨论了二进制数的有趣话题以及我们为什么使用它们。

When we sample an analog signal, as shown in Figure 5-25(a), the digital signal’s sequence of numbers is not in the form of the decimal numbers that we’re so familiar with in our daily lives. The digital signal’s sequence of numbers, n1, n2, n3, . . . , is in the form of what we call binary numbers. The interesting topics of binary numbers and why we use them are discussed in Chapter 9.

您应该记住什么

What You Should Remember

本章中应记住的概念是:

The concepts you should remember from this chapter are:

• 要使用一系列样本正确表示最高频率成分为 f 个每秒周期 (Hz) 的连续(模拟)现象,采样率必须大于 f (奈奎斯特采样准则) 的两倍。

• To correctly represent a continuous (analog) phenomenon whose highest frequency content is f cycles per second (Hz) with a sequence of samples, the sample rate must be greater than two times f (the Nyquist sampling criterion).

• 使用 fs Hz 的采样率进行模数转换后,任何频率大于 fs/2 Hz 的采样模拟正弦波将始终在频率上向下转换,以在 0 Hz 到 fs2 Hz 的范围内。

• After analog-to-digital conversion using a sample rate of fs Hz, any sampled analog sine wave whose frequency is greater than fs/2 Hz will always be translated down in frequency to be in the range of zero Hz to fs2 Hz.

• 任何数字正弦波信号(离散样本序列),如图 5-13 所示,都表示无限数量的高频模拟正弦波的采样版本。

• Any digital sine wave signal (a sequence of discrete samples), such as that in Figure 5-13, represents a sampled version of an infinite number of high-frequency analog sine waves.

• 在采样模拟信号的许多实际应用中,硬件抗混叠滤波器用于消除施加到模数转换器的模拟信号中不需要的高频内容。

• In many real-world applications of sampling analog signals, hardware anti-aliasing filters are used to eliminate the unwanted high-frequency content of an analog signal applied to an analog-to-digital converter.

6. 我们如何计算数字信号频谱

6. How We Compute Digital Signal Spectra

计算数字光谱

Computing Digital Spectra

数字信号处理最重要的方面之一是计算数字信号的频谱幅度,并在计算机屏幕上显示,如图 6-1 所示。检查数字信号频谱的能力对于信号处理工程师来说与显微镜对医学研究人员一样重要。

One of the most important aspects of digital signal processing is the computation, and display on a computer screen, of the spectral amplitude of a digital signal as shown in Figure 6-1. The ability to examine the spectrum of a digital signal is as crucial to a signal processing engineer as a microscope is to a medical researcher.

Image

图 6-1计算和显示数字信号的频谱。

Figure 6-1 Computing and displaying the spectrum of a digital signal.

今天,有两种主要方法可用于计算数字信号频谱,这两种方法具有离散傅里叶变换快速傅里叶变换的花哨名称。本章简要介绍了这两种功能等效的频谱计算方法,并以一个为感兴趣的读者计算数字信号频谱的示例结束。

Today, there are two primary methods available to compute digital signal spectra, and those two procedures have the fancy names of the discrete Fourier transform and the fast Fourier transform. This chapter briefly introduces those two functionally equivalent spectral computational methods, and ends with an example of computing a digital signal spectrum for the interested reader.

离散傅里叶变换

The Discrete Fourier Transform

离散傅里叶变换是一个数学过程,其中数字信号样本的输入序列与不同频率的数字正弦和余弦序列数组相关联,以计算表示原始数字信号频谱内容的新样本序列。呼!那真是拗口!我们只能说,离散傅里叶变换(通常称为 DFT)是对数字信号序列执行的数学过程,用于计算其频谱,然后可以将这些频谱结果绘制在计算机屏幕上。

The discrete Fourier transform is a mathematical process in which an input sequence of digital signal samples is correlated with an array of digital sine and cosine sequences of different frequencies to compute a new sequence of samples that represents the spectral content of the original digital signal. Whew! That was a mouthful! Let’s just say that the discrete Fourier transform (popularly known as the DFT) is a mathematical process performed on digital signal sequences to compute their spectra, and those spectral results can then be plotted on a computer screen.

虽然基本上是一组算术比较或相关性,但离散傅里叶变换在数学上太复杂了,无法在这里以任何有意义的方式描述其内部代数细节。然而,我们必须提到离散傅里叶变换的重要特性之一。执行离散傅里叶变换需要大量的算术计算。例如,假设我们想计算以 fs = 8,000 Hz 的速率采样的数字语音信号的一秒间隔的频谱。使用离散傅里叶变换来计算数字语音信号的频谱需要我们执行超过 1.28 亿次加法运算和超过 2.56 亿次乘法运算来计算频谱 X1, X2, X3, . . .样本值,如图 6-1 所示。称其为“一些严重的数字运算”说得太温和了。而获得较长持续时间信号频谱的计算工作量,以更高的 fs 采样率采样,变得真正是天文数字。幸运的是,由于已故数学家的出色工作和现代数字计算机的使用,今天有了一种更有效的计算数字信号频谱的方法。

Although basically a set of arithmetic comparisons or correlations, the discrete Fourier transform is far too mathematically complicated to describe its inner algebraic details in any meaningful way here. However, we must mention one of the discrete Fourier transform’s important characteristics. Performing a discrete Fourier transform requires an astonishingly large number of arithmetic computations. For example, let’s say we want to compute the spectrum of just a one-second interval of a digital voice signal sampled at a rate of fs = 8,000 Hz. Using the discrete Fourier transform to compute the digital voice signal’s spectrum requires us to perform over 128 million addition operations and over 256 million multiplication operations to compute the spectral X1, X2, X3, . . . sample values as depicted in Figure 6-1. To call this “some serious number crunching” is putting it far too mildly. And the computational workload to obtain the spectrum of longer time-duration signals, sampled at higher fs sample rates, becomes truly astronomical. Fortunately, thanks to the brilliant work of dead mathematicians and the use of modern digital computers, today there is a more efficient way to compute digital signal spectra.

快速傅里叶变换

The Fast Fourier Transform

1960 年代中期在美国开发的快速傅里叶变换是一种用于计算数字信号频谱的替代数学技术。事实上,快速傅里叶变换(通常称为 FFT)计算的结果与离散傅里叶变换计算的结果相同。但是,与离散傅里叶变换相比,快速傅里叶变换所需的算术计算次数大大减少。

The fast Fourier transform, developed in the United States in the mid-1960s, is an alternate mathematical technique for computing the spectra of digital signals. In fact, the fast Fourier transform (popularly known as the FFT) computes identical results to those computed by the discrete Fourier transform. However, the number of arithmetic computations needed by the fast Fourier transform compared to the discrete Fourier transform is dramatically reduced.

作为快速傅里叶变换计算效率的一个例子,回想一下上面的场景,我们想计算以 fs = 8,000 Hz 的速率采样的数字语音信号的一秒间隔频谱。使用快速傅里叶变换执行此操作大约需要 100,000 次加法运算和 200,000 次乘法运算。与离散傅里叶变换所需的计算相比,计算量减少了 1,000 倍。我们要说的是,对于快速傅里叶变换所需的每个乘法运算,离散傅里叶变换需要 1,000 次乘法!因此,快速傅里叶变换是现代信号处理工程师首选的频谱计算方法。

As an example of the fast Fourier transform’s computational efficiency, recall the scenario above where we wanted to compute the spectrum of a one-second interval of a digital voice signal sampled at a rate of fs = 8,000 Hz. Doing this using the fast Fourier transform requires roughly 100,000 addition operations and 200,000 multiplication operations. That’s a computation reduction by a factor of 1,000 compared to the computations required by the discrete Fourier transform. What we’re saying is that for each multiplication operation required by the fast Fourier transform, the discrete Fourier transform requires 1,000 multiplications! Consequently, the fast Fourier transform is the spectral computation method of choice among modern signal processing engineers.


顺便一提

By the Way

傅里叶变换以 19 世纪法国数学家和科学家让·巴蒂斯特·约瑟夫·傅里叶 (Jean Baptiste Joseph Fourier) 的名字命名。(傅立叶这个名字的发音是 'for-YAY, like obey。1822 年,作为拿破仑·波拿巴的朋友,傅立叶率先提出周期波形可以描述为各种正弦波形的总和。

The Fourier transform is named after the 19th-century French mathematician and scientist, Jean Baptiste Joseph Fourier. (The name Fourier is pronounced ‘for-YAY, like obey.) A friend of Napoléon Bonaparte, in 1822 Fourier was the first person to propose that periodic waveforms can be described as the sum of various sinusoidal waveforms.


光谱计算示例

A Spectral Computation Example

对于那些愿意继续阅读的勇敢读者,本节提供了一个关于如何计算数字信号频谱的简单示例。在第 3 章中,我们讨论了一个方波状模拟信号,它是 2 Hz 正弦波加上较低幅度的 6 Hz 和 10 Hz 正弦波之和,如图 6-2(b) 所示。复合信号的数字信号版本如图 6-2(c) 所示。

This section provides, for those courageous readers willing to continue, a simple example of how the spectrum of a digital signal is computed. In Chapter 3, we discussed a square wave-like analog signal that was the sum of a 2 Hz sine wave plus lower-amplitude 6 Hz and 10 Hz sine waves as shown in Figure 6-2(b). A digital signal version of the composite signal is given in Figure 6-2(c).

Image

图 6-2方波状信号:(a) 单独的模拟 2 Hz、6 Hz 和 10 Hz 正弦波;(b) 正弦波的模拟和;(c) 以每秒 40 个样本的速率 (fs = 40 Hz) 采样的正弦波和的数字信号版本。

Figure 6-2 A square wave-like signal: (a) individual analog 2 Hz, 6 Hz, and 10 Hz sine waves; (b) analog sum of the sine waves; (c) a digital signal version of the sum of the sine waves sampled at a rate of 40 samples per second (fs = 40 Hz).

计算

The Computations

我们示例中的目标是计算图 6-2(c) 数字信号的频谱。从概念上讲,离散傅里叶变换和快速傅里叶变换都计算图 6-2(c) 数字信号序列的频谱,如下所示:

The goal in our example is to compute the spectrum of the Figure 6-2(c) digital signal. Conceptually, both the discrete Fourier transform and the fast Fourier transform compute the spectrum of the Figure 6-2(c) digital signal sequence as follows:

1. 数字信号序列有 40 个样本;n1, n2, n3, . . . , n40,如图 6-3(a) 所示。首先,我们创建一个具有 40 个样本的单周期正弦波序列,如图 6-3(b) 所示。

1. The digital signal sequence has 40 samples; n1, n2, n3, . . . , n40, as shown in Figure 6-3(a). First, we create a single-cycle sine wave sequence having 40 samples as shown in Figure 6-3(b).

Image

图 6-3计算第一频谱样本值 X1:(a) 数字信号序列;(b) 单周期正弦波序列。

Figure 6-3 Computing the first spectral sample value X1: (a) the digital signal sequence; (b) a single-cycle sine wave sequence.

2. 将数字信号中的每个样本乘以单周期正弦波序列中的相应样本,得到 40 个产物。也就是说,第一个乘积是 P1 = n1 × s1。(“x” 表示乘以,乘法。第二个乘积是 P2 = n2 × s2,第三个乘积是 P3 = n3 × s3,依此类推,直到第 40 个乘积 P40 = n40 × s40。

2. Multiply each sample in the digital signal by its corresponding sample in the single-cycle sine wave sequence, resulting in 40 products. That is, the first product is P1 = n1 × s1. (The “x” means times, a multiplication.) The second product is P2 = n2 × s2, the third product is P3 = n3 × s3, and so on up to the 40th product P40 = n40 × s40.

3. 然后,我们将 40 个产品相加,得到我们的第一个光谱样本值 X1。也就是说,X1 = P1 × P2 + P3 + . . . + P40.因为有些产品是正的,而有些产品是负的,所以在我们的示例中,这些产品的总和正好为零。所以 X1 = 0。

3. Then, we sum the 40 products to obtain our first spectral sample value X1. That is, X1 = P1 × P2 + P3 + . . . + P40. Because some of the products are positive and some of the products are negative, for our example those products sum to exactly zero. So X1 = 0.

4. 接下来,创建一个具有 40 个样本的双周期正弦波序列,如图 6-4(b) 所示。

4. Next, create a two-cycle sine wave sequence, having 40 samples, as shown in Figure 6-4(b).

Image

图 6-4计算第二个频谱样本值 X2:(a) 数字信号序列;(b) 一个双周期正弦波序列。

Figure 6-4 Computing the second spectral sample value X2: (a) the digital signal sequence; (b) a two-cycle sine wave sequence.

5. 将数字信号中的每个样品乘以双周期正弦波序列中的相应样品,得到 40 个产物。同样,第一个乘积是 P1 = n1 × s1。第二个乘积是 P2 = n2 × s2,第三个乘积是 P3 = n3 × s3,依此类推,直到第 40 个乘积 P40 = n40 × s40。

5. Multiply each sample in the digital signal by its corresponding sample in the two-cycle sine wave sequence, resulting in 40 products. Again, the first product is P1 = n1 × s1. The second product is P2 = n2 × s2, the third product is P3 = n3 × s3, and so on up to the 40th product P40 = n40 × s40.

6. 将 40 个产品相加,得到第二个光谱样本值。也就是说,X2 = P1 + P2 + P3 + . . . . + P40.在我们的示例中,这些产品的总和为 20。所以 X2 = 20。

6. Sum the 40 products to obtain our second spectral sample value. That is, X2 = P1 + P2 + P3 + . . . + P40. For our example, those products sum to 20. So X2 = 20.

7. 接下来,创建一个具有 40 个样本的三周期正弦波序列,如图 6-5(b) 所示。

7. Next, create a three-cycle sine wave sequence, having 40 samples, as shown in Figure 6-5(b).

Image

图 6-5计算第三个频谱样本值 X3:(a) 数字信号序列;(b) 一个三周期的正弦波序列。

Figure 6-5 Computing the third spectral sample value X3: (a) the digital signal sequence; (b) a three-cycle sine wave sequence.

8. 和以前一样,将数字信号中的每个样本乘以三周期正弦波序列中的相应样本,再次得到 40 个产物。

8. As before, multiply each sample in the digital signal by its corresponding sample in the three-cycle sine wave sequence, again resulting in 40 products.

9. 将 40 个乘积相加,得到第三个光谱样本值 X3 = P1 + P2 + P3 + . . . . + P40。在我们的示例中,这些产品的总和为零。所以 X3 = 0。

9. Sum the 40 products to obtain our third spectral sample value X3 = P1 + P2 + P3 + . . . + P40. For our example, those products sum to zero. So X3 = 0.

10. 再重复步骤 7 到 9 17 次,每次将正弦波序列中的周期数增加 1,直到我们计算出 20 个光谱样本值,X1 到 X20。

10. Repeat steps 7 through 9 another 17 times, increasing the number of cycles in the sine wave sequence by one each time, until we have computed 20 spectral samples values, X1 to X20.

11. 将 20 个频谱样本值绘制在以频率为横轴的图表上。

11. Plot the 20 spectral samples values on a graph with frequency as the horizontal axis.

对我们的方波状数字信号执行上述步骤,得到表 6.1 中列出的 20 个频谱样本值。最后,绘制这些光谱样本值会产生我们想要的光谱图,如图 6-6 所示。(图 6-6(a)6-6(b) 显示了两种流行的绘图方法。一个图使用点表示光谱样本,另一个图用实线连接光谱样本值并删除点。在该图中,我们看到数字信号包含一个高振幅的 2 Hz 频谱分量、一个较低振幅的 6 Hz 频谱分量和一个略低振幅的 10 Hz 频谱分量。查看图 6-2(a) 后,我们可以看到图 6-6 的光谱结果是正确的。

Performing the steps above for our square wave-like digital signal gives us the 20 spectral sample values listed in Table 6.1. And, finally, plotting those spectral sample values produces our desired spectral plot shown in Figure 6-6. (Figures 6-6(a) and 6-6(b) show two popular plotting methods. One plot uses dots to represent the spectral samples, and the other plot connects the spectral sample values with solid lines and deletes the dots.) In that figure, we see that the digital signal contained a high-amplitude 2 Hz spectral component, a lower-amplitude 6 Hz spectral component, and a slightly lower-amplitude 10 Hz spectral component. Upon reviewing Figure 6-2(a), we see that our Figure 6-6 spectral results are correct.

Image

表 6.1Spectral Sample 值

Table 6.1 Spectral Sample Values

Image

图 6-6方波状数字信号的频谱。两种绘图格式:(a) 使用点表示光谱样本;(b) 连接光谱样本值和去除的点的实线。

Figure 6-6 Spectrum of the square wave-like digital signal. Two plotting formats: (a) using dots to represent the spectral samples; (b) solid lines connecting the spectral sample values and dots removed.

计算的含义

What the Computations Mean

对于上面的示例,在图 6-3 中,当我们将数字信号中的每个样本乘以单周期正弦波序列中的相应样本并对 40 个乘积求和时,我们得出的值为 X1 = 0。乘积求和运算为我们提供了一个数值 X1 = 0,表示单周期正弦波序列与方波类数字信号相比有多好。X1 = 0 值告诉我们,我们的数字信号与 1 Hz 正弦波序列相比非常差。换句话说,X1 = 0 值表明我们的数字信号包含零量的 1 Hz 频谱能量。

For the example above, in Figure 6-3 when we multiplied each sample in the digital signal by its corresponding sample in the single-cycle sine wave sequence and summed the 40 products, we arrived at a value of X1 = 0. That summing of products operation gives us a single numerical value, X1 = 0, indicating how well the single-cycle sine wave sequence compared with the square wave-like digital signal. The X1 = 0 value tells us our digital signal compares very poorly with the 1 Hz sine wave sequence. Stated differently, the X1 = 0 value reveals that our digital signal contains a zero amount of 1 Hz spectral energy.

但是,在图 6-4 中,我们将数字信号中的每个样本乘以两个周期正弦波序列中的相应样本,并将 40 个乘积相加,得到 X2 = 20 的值。X2 = 20 值告诉我们,我们的数字信号与 2 Hz 正弦波序列相比非常好。(两个周期正弦波序列的波峰和波谷与我们的方波状数字信号的正值和负值非常一致。也就是说,X2 = 20 值表明我们的数字信号包含大量 2 Hz 的频谱能量。

However, in Figure 6-4 we multiplied each sample in the digital signal by its corresponding sample in the two-cycle sine wave sequence and summed the 40 products to yield a value of X2 = 20. The X2 = 20 value tells us our digital signal compares very well with the 2 Hz sine wave sequence. (The peaks and valleys of the two-cycle sine wave sequence are very well aligned with the positive and negative values of our square wave-like digital signal.) That is, the X2 = 20 value reveals that our digital signal contains a large amount of 2 Hz spectral energy.

当我们继续对产品进行求和操作时,我们发现我们的数值比较始终为零值,除非正弦波序列的频率为 2、6 和 10 Hz。因此,我们的方波状数字信号在 2、6 和 10 Hz 的频率下包含不同数量的频谱能量。

As we continued our summing of products operations, we found that our numerical comparisons were always zero-valued except when the sine wave sequences had frequencies of 2, 6, and 10 Hz. Therefore, our square wave-like digital signal contained varying amounts of spectral energy at the frequencies of 2, 6, and 10 Hz.


顺便一提

By the Way

数学家为我们的 summation of products 操作起了一个名字,你以前听说过这个名字。这称为相关性。在第 7 章 小波中,我们将了解涉及正弦波以外的波形的比较。敬请期待。

Mathematicians have a name for our summation of products operation, and you’ve heard that name before. It’s called correlation. In Chapter 7, Wavelets, we’ll read about comparisons that involve waveforms other than sine waves. Stay tuned.


光谱分析示例

A Spectral Analysis Example

让我们考虑一个真实的频谱分析示例。想想一个大型电动机,如图 6-7(a) 所示,它位于一家制造公司的工厂车间。(大体上,我们的意思是,比如说,一个啤酒桶的大小。也许电机驱动重型液压泵,或者可能是大型传送带。无论如何,让我们假设电机的驱动齿轮转动更大的齿轮,如图 6-7(b) 所示。

Let’s consider a real-world spectral analysis example. Think about a large electric motor, shown in Figure 6-7(a), located on the factory floor of a manufacturing company. (By large, we mean, say, the size of a beer keg.) Perhaps the motor drives a heavy-duty hydraulic pump, or maybe a large conveyor belt. In any case, let’s assume the motor’s drive gear turns a larger gear as shown in Figure 6-7(b).

Image

图 6-7电动机和齿轮:(a) 电动机和振动测试装置;(b) 新的电机驱动齿轮;(c) 磨损的电机驱动装置。

Figure 6-7 Electric motor and gears: (a) motor and vibration test setup; (b) new motor drive gear; (c) worn motor drive gear.

首次安装电机和任何连接的设备时,齿轮的齿啮合得非常好,如图 6-7(b) 所示。但随着时间的推移,驱动齿轮会磨损,如图 6-7(c) 所示。当驱动齿轮的齿严重磨损时,可能会发生意外的设备故障,工厂工程师不喜欢意外的设备故障。

When the motor, and any attached equipment, is first installed, the teeth of the gears mesh very well as shown in Figure 6-7(b). But over time, the drive gear becomes worn as shown in Figure 6-7(c). And when the teeth of the drive gear become badly worn, an unexpected equipment failure can occur—and factory engineers don’t like unexpected equipment failures.

这些聪明的工程师能够通过对电动机的振动进行频谱分析来避免意外的电动机故障。方法如下:事实证明,当新电机和任何连接的机械设备首次在工厂安装时,工程师会将振动传感器连接到电机外壳上,如图 6-7(a) 所示。(就像麦克风将由气压波动组成的声音信号转换为电压信号一样,振动传感器将机械振动转换为电压。通过模数转换器,模拟振动信号被转换为数字信号,然后传递到计算机。计算机使用快速傅里叶变换软件来计算和显示新工厂安装的振动频谱。如果电机以每秒 20 转的速度旋转,并且电机的驱动齿轮有 12 个齿,则振动频谱将包含 20 × 12 × 240 Hz 的频谱分量(除了电机本身的 20 Hz 分量),如图 6-8(a) 所示。

Those clever engineers are able to avoid unexpected electric motor failures by performing spectrum analysis on the vibration of their electric motors. Here’s how: As it turns out, when a new motor, and any connected mechanical equipment, is first installed in a factory, engineers attach a vibration sensor to the motor’s case as shown in Figure 6-7(a). (Just as a microphone converts a sound signal, which consists of fluctuations in air pressure, into a voltage signal, the vibration sensor converts mechanical vibrations into an electrical voltage.) By means of an analog-to-digital converter, the analog vibration signal is converted to a digital signal, which is then passed to a computer. The computer uses fast Fourier transform software to compute and display the vibrational spectrum of a new factory installation. If the motor is rotating at 20 revolutions per second, and the motor’s drive gear has 12 teeth, the vibration spectrum will contain a 20 × 12 × 240 Hz spectral component (in addition to the 20 Hz component from the motor itself) as shown in Figure 6-8(a).

Image

图 6-8电机振动谱:(a) 新的电机振动谱;(b) 磨损齿轮电机振动谱。

Figure 6-8 Motor vibration spectra: (a) new motor vibration spectrum; (b) worn-gear motor vibration spectrum.

现在,当电机驱动齿轮的齿磨损时,会导致电机外壳振动增加。因此,在安装几个月后,工厂工程师会重复他们的电机振动频谱测试。假设新的频谱显示如图 6-8(b) 所示。看到 240 Hz 频谱分量的幅度增加,工程师们放大了 240 Hz 频率的频谱显示,如图 6-9 所示。从该显示屏上,工程师知道驱动齿轮的齿正在磨损。这样,工程师可以安排对工厂生产过程干扰最小的纠正性维护。

Now when the teeth of the motor’s drive gear become worn, it causes increased motor-case vibration. So some months after installation, the factory engineers repeat their motor vibration spectral test. Let’s say the new spectrum display is that shown in Figure 6-8(b). Seeing an increased amplitude of the 240 Hz spectral component, the engineers zoom in on the spectral display at the 240 Hz frequency as shown in Figure 6-9. From that display, the engineers know that the drive gear’s teeth are becoming worn. This way, the engineers can schedule corrective maintenance that is the least disruptive to the factory’s production process.

Image

图 6-9磨损的齿轮电机振动频谱细节。

Figure 6-9 Worn-gear motor vibration spectrum detail.

您应该记住什么

What You Should Remember

本章中应记住的概念是:

The concepts you should remember from this chapter are:

• 离散傅里叶变换 (DFT) 和快速傅里叶变换 (FFT) 是功能上等效的数学方法,用于计算数字信号的频谱。

• The discrete Fourier transform (DFT) and the fast Fourier transform (FFT) are functionally equivalent mathematical methods for computing the spectra of digital signals.

• 离散傅里叶变换需要大量的算术计算。

• The discrete Fourier transform requires a very large number of arithmetic computations.

• 快速傅里叶变换需要相对较少的算术计算,是目前计算数字信号频谱的最流行方法。

• The fast Fourier transform requires relatively few arithmetic computations, and is now the most popular method for computing the spectra of digital signals.

7. 小波

7. Wavelets

在数字信号处理领域有一门学科称为小波。正如我们将在这里解释的那样,小波变换类似于傅里叶变换,不同之处在于使用小波,我们可以同时找到感兴趣信号特征的频率时间。小波处理广泛用于信号和图像处理、医学、金融、雷达、声纳、地质学和许多其他不同领域。小波通常以数学公式表示,但实际上可以通过与我们正在分析的信号数据的简单比较来理解。

There is a discipline in the field of digital signal processing called wavelets. As we’ll explain here, wavelet transforms are similar to Fourier transforms except that with wavelets, we can find both the frequency and the time of interesting signal characteristics. Wavelet processing is used extensively in signal and image processing, medicine, finance, radar, sonar, geology, and many other varied fields. Wavelets are usually presented in mathematical formulae, but can actually be understood in terms of simple comparisons with the signal data we are analyzing.

为了提供一些背景信息,我们首先看一下快速傅里叶变换 (FFT)。该转换可以被视为与数据的一系列比较,现在我们将其称为一致性信号。频率成分不随时间变化的信号可以使用普通的 FFT 方法进行处理。

To provide some background, we first look at the fast Fourier transform (FFT). That transform can be thought of as a series of comparisons with your data, which for now we will call a signal for consistency. Signals whose frequency content does not change over time can be processed with ordinary FFT methods.

但是,实际信号的频率通常随时间变化,或者在某些特定时间具有脉冲、异常或其他事件。这种类型的信号可以告诉我们物体在地球上的位置、人类心脏的健康状况、雷达屏幕上光点的位置和速度、股票市场行为或地下石油矿藏的位置。对于这些信号,小波分析不仅能够显示信号的频谱内容,还能够指示这些频谱分量何时存在。这是一个非常强大的信号分析能力。现在,我们演示了简单脉冲信号的快速傅里叶变换和小波变换。

Real-world signals, however, often have frequencies that change over time or have pulses, anomalies, or other events at certain specific times. This type of signal can tell us where something is located on the planet, the health of a human heart, the position and velocity of a blip on a radar screen, stock market behavior, or the location of underground oil deposits. For these signals, wavelet analysis has the capability to show not only the spectral content of a signal, but also to indicate when in time those spectral components exist. That is a very powerful signal analysis capability. We now demonstrate both the fast Fourier and wavelet transforms of a simple pulse signal.

快速傅里叶变换 (FFT) — 快速回顾

The Fast Fourier Transform (FFT)—A Quick Review

我们首先将脉冲信号 (D) 与恒定频率 (A) 的高频正弦波逐点比较,如图 7-1 所示。我们从这个比较中得到一个优度值(一个相关值),它表示在我们的脉冲信号中发现了多少特定的正弦波。

We start with a point-by-point comparison of the pulse signal (D) with a high-frequency sinusoid wave of constant frequency (A) as shown in Figure 7-1. We obtain a single goodness value from this comparison (a correlation value), which indicates how much of that particular sinusoid wave is found in our pulse signal.

Image

图 7-1示例波形的快速傅里叶变换 (FFT) 比较。

Figure 7-1 Fast Fourier transform (FFT) comparison of example waveforms.

我们可以观察到脉冲 D 在四分之一秒内有 5 个周期。这意味着它的频率为 1 秒或 20 Hz 内 20 次循环。比较正弦波 A 的频率是其两倍,即 40 Hz。即使在 D 信号非零区域(脉冲),比较也不是很好。

We can observe that the pulse D has 5 cycles in one-quarter of a second. This means it has a frequency of 20 cycles in one second or 20 Hz. The comparison sinusoid, A, has twice the frequency or 40 Hz. Even in the area where the D signal is non-zero (the pulse), the comparison is not very good.

通过将 A 的频率从 40 Hz 降低到 20 Hz(波形 B),我们有效地将正弦波 (A) 拉伸了 2 倍,使其在 1 秒内只有 20 个周期。我们在 1 秒的间隔内再次与脉冲 D 进行逐点比较。这种相关性为我们提供了另一个值,该值表示脉冲信号中包含多少这个低频正弦波(现在与我们的脉冲频率相同)。这一次,脉冲与比较 20 Hz 正弦曲线的相关性非常好。B 的峰和谷以及 D 的脉冲部分对齐(或者可以很容易地偏移以对齐),因此我们有一个很大的相关值。

By lowering the frequency of A from 40 to 20 Hz (waveform B), we are effectively stretching the sinusoid (A) by 2 so it has only 20 cycles in 1 second. We compare point-by-point again over the 1-second interval with the pulse D. This correlation gives us another value that indicates how much of this lower frequency sinusoid (now the same frequency as our pulse) is contained in our pulse signal. This time, the correlation of the pulse with the comparison 20 Hz sinusoid is very good. The peaks and valleys of B and the pulse portion of D align (or can be easily shifted to align) and thus we have a large correlation value.

图 7-1 向我们展示了原始正弦曲线 A 的又一次比较,该正弦曲线被拉伸了 4,因此它在 1 秒间隔 C 中只有 10 个周期。10 Hz 正弦波与脉冲信号 D 的比较同样很差。我们可以继续拉伸,直到比较正弦波变成一条频率为零的直线,但所有这些比较都会越来越差。

Figure 7-1 shows us one more comparison of our original sinusoid A stretched by 4 so it has only 10 cycles in the 1-second interval, C. The comparison of the 10 Hz sine wave with pulse signal D is again poor. We could continue stretching until the comparison sine wave becomes a straight line having zero frequency, but all those comparisons will be increasingly poor.

快速傅里叶变换 (FFT) 将许多拉伸的正弦曲线与脉冲进行比较,而不仅仅是图 7-1 中所示的 3 个。当正弦频率与脉冲频率最匹配时,可以找到最佳相关性。图 7-2 显示了脉冲信号 D 的实际 FFT 的第一部分。显示了我们的样本比较正弦曲线 A、B 和 C 的位置。请注意,FFT 正确地告诉我们脉冲的频率主要是 20 Hz,但没有告诉我们脉冲在时间上的位置!

A fast Fourier transform (FFT) compares many stretched sinusoids to the pulse rather than just the 3 shown in Figure 7-1. The best correlation is found when the sinusoid frequency best matches the frequency of the pulse. Figure 7-2 shows the first part of an actual FFT of our pulse signal D. The locations of our sample comparison sinusoids A, B, and C are indicated. Notice that the FFT correctly tells us that the pulse has primarily a frequency of 20 Hz, but does not tell us where the pulse is located in time!

Image

图 7-2图 7-1 的 D 脉冲信号的 FFT 频谱图,显示了三个正弦曲线。

Figure 7-2 FFT spectral plot of Figure 7-1’s D pulse signal, with the three sinusoids indicated.

连续小波变换 (CWT)

The Continuous Wavelet Transform (CWT)

小波令人兴奋,因为它们也是比较,但它们不是与各种拉伸的、无限长的、不变的正弦曲线相关,而是使用更小或更短的波形(小波),可以在我们想要的地方开始和停止。

Wavelets are exciting because they, too, are comparisons, but instead of correlating with various stretched, infinite-length, unchanging sinusoids, they use smaller or shorter waveforms (wave-lets) that can start and stop where we wish.

使用所谓的连续小波变换 (CWT),通过多次拉伸和移动小波,我们获得了许多相关性。如果我们正在分析的信号中嵌入了一些有趣的事件,那么当拉伸的小波在频率上与事件相似并且偏移以与事件同步时,我们将获得最佳相关性。知道会产生较大比较结果值的拉伸和时移量,我们可以确定信号中有趣事件的频率和发生时间。

Using what is called the continuous wavelet transform (CWT), by stretching and shifting the wavelet numerous times we obtain numerous correlations. If our signal under analysis has some interesting events embedded in it, we will get the best correlation when the stretched wavelet is similar in frequency to the event and is shifted to line up in time with the event. Knowing the amounts of stretching and time shifting, which produce large comparison result values, we can determine both the frequency, and time of occurrence, of interesting events within a signal.

图 7-3 演示了该过程。我们将使用小波,而不是正弦曲线进行比较。波形 A 显示了所谓的 Daubechies 20 小波,大约八分之一秒长,从开始 (t = 0) 开始,实际上在四分之一秒之前结束。零值将扩展到完整的 1 秒。与我们的脉冲信号 D 的逐点比较将非常差,我们将获得非常小的相关值。

Figure 7-3 demonstrates the process. Instead of sinusoids for our comparisons, we will use wavelets. Waveform A shows what is called a Daubechies 20 wavelet about one-eighth of a second long that starts at the beginning (t = 0) and effectively ends well before one-quarter of second. The zero values are extended to the full 1 second. The point-by-point comparison with our pulse signal D will be very poor and we will obtain a very small correlation value.

Image

图 7-3脉冲信号与几个拉伸和移位小波的 CWT 类型比较。

Figure 7-3 CWT-type comparison of pulsed signal with several stretched and shifted wavelets.

在之前的 FFT 讨论中,我们直接进入了拉伸。在小波变换中,我们将小波稍微向右移动,并与这个新波形进行另一次比较,以获得另一个相关值。我们继续移动,直到 Daubechies 20 小波处于 B 中所示的八分之三秒时间位置。我们得到的比较比 A 好一点,但它仍然很差,因为 B 和 D 是不同的频率。

In the previous FFT discussion, we proceeded directly to stretching. In wavelet transforms, we shift the wavelet slightly to the right and perform another comparison with this new waveform to get another correlation value. We continue to shift until the Daubechies 20 wavelet is in the three-eighths-of-a-second time position shown in B. We get a little better comparison than A, but it’s still very poor because B and D are different frequencies.

在我们将小波一直移动到 1 秒时间间隔的末尾后,我们从开始时略微拉伸的小波重新开始,然后反复向右移动以获得另一组完整的相关值。C 显示了 Daubechies 20 小波,它被拉伸到频率与脉冲 (D) 大致相同的位置,并向右移动,直到波峰和波谷对齐得相当好。在这个特定的 shift 和 stretching,我们应该获得非常好的比较和较大的相关性值。然而,即使在相同的拉伸下,进一步向右移动也会产生越来越差的相关性。

After we have shifted the wavelet all the way to the end of the 1-second time interval, we start over with a slightly stretched wavelet at the beginning and repeatedly shift to the right to obtain another full set of these correlation values. C shows the Daubechies 20 wavelet stretched to where the frequency is roughly the same as the pulse (D) and shifted to the right until the peaks and valleys line up fairly well. At this particular shifting and stretching, we should obtain a very good comparison and large correlation value. Further shifting to the right, however, even at this same stretching, will yield increasingly poor correlations.

在连续小波变换 (CWT) 中,每个拉伸小波的每个偏移都有一个相关值。为了显示所有这些拉伸和偏移的相关性(比较)结果,我们使用三维显示,以拉伸(大致是频率的倒数)为纵轴,以时间变化为横轴,亮度来表示相关性的强度。图 7-4 显示了图 7-3 脉冲信号 (D) 的连续小波变换显示。请注意脉冲的波峰和波谷与 Daubechies 20 小波的强相关性(明亮区域),最强(最亮)是所有波峰和波谷最对齐的地方。

In the continuous wavelet transform (CWT), we have one correlation value for every shift of every stretched wavelet. To show the correlation (comparison) results of all these stretches and shifts, we use a three-dimensional display with the stretching (roughly the inverse of frequency) as the vertical axis, the shifting in time as the horizontal axis, and brightness to indicate the strength of the correlation. Figure 7-4 shows a continuous wavelet transform display for the Figure 7-3 pulse signal (D). Note the strong correlation (bright areas) of the peaks and valleys of the pulse with the Daubechies 20 wavelet, the strongest (brightest) being where all the peaks and valleys best align.

Figure 7-4 shows that the best correlation occurs at the brightest points, between one-quarter and one-half of a second. This agrees with what we already know about the pulse (D). Figure 7-4 also tells us how much the wavelet had to be stretched (or scaled) and this indicates the approximate frequency of the pulse in our pulse signal. Thus, we know not only the frequency of the pulse, but also the time of its occurrence!

Figure 7-4 shows that the best correlation occurs at the brightest points, between one-quarter and one-half of a second. This agrees with what we already know about the pulse (D). Figure 7-4 also tells us how much the wavelet had to be stretched (or scaled) and this indicates the approximate frequency of the pulse in our pulse signal. Thus, we know not only the frequency of the pulse, but also the time of its occurrence!

Image

图 7-4CWT 显示屏指示脉冲信号的时间和频率。(白色条带显示信号和小波的波峰和波谷在什么时间对齐。

Figure 7-4 CWT display indicating the time and frequency of the pulse signal. (White bands show at what time the peaks and valleys of both the signal and the wavelet are aligned.)

我们在日常生活中会遇到这种同步时间/频率概念。例如,一小节乐谱可以告诉钢琴家在小节的第一拍上同时弹奏三个不同频率的 C 和弦。

We run into this simultaneous time/frequency concept in everyday life. For example, a bar of sheet music may tell the pianist to play a C chord of three different frequencies at exactly the same time on the first beat of the measure.

对于简单的图 7-3 示例,我们可以只查看脉冲 (D) 以查看其位置和频率。下一个例子更能代表现实世界中的小波。

For the simple Figure 7-3 example, we could have just looked at the pulse (D) to see its location and frequency. The next example is more representative of wavelets in the real world.

图 7-5(a) 显示了在 Time = 180 处具有非常小、非常短时间不连续性的正弦波信号。信号的振幅与时间图不显示微小事件。标准的快速傅里叶变换 (FFT) 幅度与频率图可以告诉我们不完美的正弦波信号中存在哪些频率,但不会指示这些频率在什么时间值存在。

Figure 7-5(a) shows a sine wave signal with a very small, very short-time discontinuity at Time = 180. The amplitude versus time plot of the signal does not show the tiny event. A standard fast Fourier transform (FFT) amplitude versus frequency plot would tell us what frequencies are present in the imperfect sine wave signal but would not indicate at what value of time those frequencies existed.

Image

图 7-5探测到一个小的振幅不连续性:(a) 在 Time = 180 处包含隐藏不连续性的正弦波信号;(b) 具有隐藏不连续性的正弦波信号的 CWT。

Figure 7-5 Detecting a small amplitude discontinuity: (a) sine wave signal containing a hidden discontinuity at Time = 180; (b) CWT of a sine wave signal with a hidden discontinuity.

然而,在图 7-5(b) 中的小波显示中,在该图的底部,我们可以清楚地看到 Time = 180 处的垂直白色带,此时小波的拉伸非常小,表明频率非常高。但对我们来说更重要的是,这种微小的不连续性已经被及时精确地识别出来。CWT 显示还可以在小波被拉伸的较高尺度上找到大的振荡波,并与较低的频率很好地进行比较。对于这个短的不连续性,我们使用了一个称为 Daubechies 4 小波的短小波,以获得最佳比较。

With the wavelet display in Figure 7-5(b), however, at the bottom of that figure we can clearly see a vertical white band at Time = 180 at low scales when the wavelet has very little stretching, indicating a very high frequency. But more important to us, this tiny discontinuity has been precisely identified in time. The CWT display also finds the large oscillating wave at the higher scales where the wavelet has been stretched and compares well with the lower frequencies. For this short discontinuity, we used a short wavelet called a Daubechies 4 wavelet for best comparison.

这是一个例子,说明为什么小波被称为数学显微镜,因为它们能够发现隐藏在信号数据中的各种长度和频率的有趣事件。

This is an example of why wavelets have been referred to as a mathematical microscope for their ability to find interesting events of various lengths and frequencies hidden in signal data.


顺便一提

By the Way

当然,在数字计算机上计算的连续小波变换并不是我们在本书中讨论的模拟信号意义上的真正连续的。用小波术语来说,这意味着我们计算的离散序列样本(移位和拉伸的所有可能的整数因子)比我们将要讨论的短序列离散小波变换多得多,相比之下,它似乎是连续的。

The continuous wavelet transform as computed on a digital computer is, of course, not really continuous in the analog signal sense we have discussed in this book. In wavelet jargon, it means that we compute so many more discrete sequence samples (all the possible integer factors of shifting and stretching) than in the short-sequence discrete wavelet transforms we are about to discuss, that it seems continuous by comparison.

你会在 wavelets 中遇到一些非常有创意的行话,因为已建立的词已经被赋予了新的定义。除了 continuous,意味着更多之外,其他例子包括:decimation by 2(与 deci 前缀无关);dilation,意思是变大或变小;翻译,意思是转移;缩放,意思是拉伸;以及适合家庭的术语,例如 motherfather, and daughter wavelets!正如 Humpty Dumpty 在《Through the Looking Glass》中所说,“当我使用一个词时,它的含义就是我选择它的意思——不多也不少。

You will encounter some very creative jargon in wavelets because established words have been given new definitions. Other examples, besides continuous, meaning more numerous, include: decimation by 2 (having nothing to do with the deci-prefix); dilation, meaning to make either larger or smaller; translation, meaning shifting; scaling, meaning stretching; and family-friendly terms such as mother, father, and daughter wavelets! As Humpty Dumpty said in Through the Looking Glass, “When I use a word, it means just what I choose it to mean—neither more nor less.”


除了充当显微镜来查找信号数据中的隐藏事件外,小波还可以将数据分离成各种频率分量,快速傅里叶变换 (FFT) 也是如此。FFT 广泛用于去除整个信号中普遍存在的不需要的噪声,例如不需要的 60 Hz 音频嗡嗡声。然而,与 FFT 不同的是,小波变换允许我们在信号数据中的特定时间去除频率分量。这使我们能够具有强大的能力,可以丢弃坏的部分并将数据的好部分保持在该频率范围内。

Besides acting as a microscope to find hidden events in our signal data, wavelets can also separate the data into various frequency components, as does the fast Fourier transform (FFT). The FFT is used extensively to remove unwanted noise that is prevalent throughout the entire signal such as unwanted 60 Hz audio hum. Unlike the FFT, however, the wavelet transform allows us to remove frequency components at specific times within the signal data. This allows us a powerful capability to throw out the bad and keep the good part of the data in that frequency range.

我们将要讨论的小波变换称为离散小波变换 (DWT)。它们还具有易于计算的逆离散小波变换 (IDWT),使我们能够在噪声去除或图像压缩应用中识别并去除不需要的噪声或多余的信号数据后重建信号。

The wavelet transforms we’re about to discuss are called discrete wavelet transforms (DWT). They also have easily computed inverse discrete wavelet transforms (IDWT) that allow us to reconstruct the signal after we have identified and removed the unwanted noise or superfluous signal data in noise-removal or image-compression applications.

未抽取或冗余离散小波变换 (UDWT/RDWT)

Undecimated or Redundant Discrete Wavelet Transforms (UDWT/RDWT)

一种类型的 DWT 是冗余离散小波变换 (RDWT),通常称为未抽取离散小波变换 (UDWT),原因我们很快就会看到。使用 RDWT,我们首先将小波滤波器与自身进行比较(关联)。这将产生高通半带滤波器超级滤波器。当我们将信号与这个超级滤波器进行比较或关联时,我们提取了最高一半的频率。对于非常简单的去噪,我们可以丢弃这些高频(无论我们选择什么时间段),然后重建一个去噪后的信号。

One type of DWT is the redundant discrete wavelet transform (RDWT), often called the undecimated discrete wavelet transform (UDWT) for reasons we will soon see. With the RDWT, we first compare (correlate) the wavelet filter with itself. This produces a highpass half-band filter or superfilter. When we compare or correlate our signal with this superfilter, we extract the highest half of the frequencies. For a very simple denoising, we could just discard these high frequencies (for whatever time period we choose) and then reconstruct a denoised signal.

多级 RDWT 允许我们拉伸小波,类似于我们在 CWT 中所做的,只是它是由 2 倍(2 倍长、4 倍长等)完成的。这允许我们使用拉伸的超级滤波器,可以是半带、四分之一带、八分之一带等。

Multi-level RDWTs allow us to stretch the wavelet, similar to what we did in the CWT, except that it is done by factors of 2 (2 times as long, 4 times as long, etc.). This allows us stretched superfilters that can be half-band, quarter-band, eighth-band, and so forth.

传统(抽取)离散小波变换 (DWT)

Conventional (Decimated) Discrete Wavelet Transforms (DWT)

我们在 CWT 和 RDWT 中拉伸了小波。在传统的 DWT 中,我们缩小信号并将其与未更改的小波进行比较。我们通过减 2 来做到这一点。信号中的每个其他点都将被丢弃。我们必须处理混叠(没有足够的样本来表示高频分量,从而产生错误信号)。我们还必须关注移位不变性。(我们是丢弃奇数值还是偶数值?这很重要!

We stretched the wavelet in the CWT and the RDWT. In the conventional DWT, we shrink the signal instead and compare it to the unchanged wavelet. We do this by decimating by 2. Every other point in the signal is discarded. We have to deal with aliasing (not having enough samples left to represent the high-frequency components and thus producing a false signal). We must also be concerned with shift invariance. (Do we throw away the odd or the even values? It matters!)

如果我们小心,我们可以处理这些问题。传统 DWT 中滤波器的一个惊人功能是混叠抵消,其中基本小波和三个类似的滤波器相结合,使我们能够完美地重建原始信号。正如我们将看到的,对小波能够做到这一点的严格要求是它们经常看起来如此奇怪的部分原因。

If we are careful, we can deal with these concerns. One amazing capability of the filters in the conventional DWT is alias cancellation where the basic wavelet and three similar filters combine to allow us to reconstruct the original signal perfectly. The stringent requirements for the wavelets to be able to do this are part of why they often look so strange, as we shall see.

与 RDWT 一样,我们可以通过丢弃从传统 DWT 获得的部分频谱来对信号进行降噪——只要我们小心不要丢弃混叠消除功能的重要部分。正确和仔细的抽取也有助于信号的压缩。

As with the RDWT, we can denoise our signal by discarding portions of the frequency spectrum obtained from a conventional DWT—as long as we are careful not to throw away vital parts of the alias cancellation capability. Correct and careful decimation also aids with compression of the signal.

在信号处理领域中,有一种非常常见的操作称为图像压缩,它是指减小图形(图片)文件的大小(以字节为单位),而不会降低不可接受的图像质量。减小图像的文件大小使我们能够在给定数量的硬盘内存中存储更多图像,并最大限度地减少通过 Internet 下载或发送图像所需的时间。现代 JPEG 图像压缩使用小波来产生图 7-6 中所示的结果。原始图像如图 7-6(a) 所示,该图像的双正交 9/7 小波压缩版本如图 7-6(b) 所示。大问题是,左侧图像文件需要的字节数是右侧小波压缩图像的 157 倍!您能看出两张图片之间有什么区别吗?

There is a very common operation used in the field of signal processing called image compression, which refers to reducing the size, measured in bytes, of a graphics (picture) file without unacceptable degradation of the image quality. Reducing an image’s file size enables us to store more images in a given amount of hard-disk memory as well as minimizing the time required to download or send images over the Internet. Modern JPEG image compression uses wavelets to produce the results demonstrated in Figure 7-6. An original image is shown in Figure 7-6(a), and a biorthogonal 9/7 wavelet-compressed version of that image is given in Figure 7-6(b). The big deal is that the left image file requires 157 times the number of bytes as the wavelet-compressed image on the right! Can you see any difference between the two images?

Image

图 7-6使用双正交 9/7 小波的 JPEG 图像压缩:(a) 压缩前;(b) 压缩后。

Figure 7-6 JPEG image compression using biorthogonal 9/7 wavelets: (a) before compression; (b) after compression.


顺便一提

By the Way

考虑到 JPEG 图像文件,您可能还听说过 MPEG 视频文件。计算机上的文件扩展名“.jpg”和“.mpg”是它们的缩写。这些是行业标准的电子文件压缩方法。JPEG 代表联合图像专家组,MPEG 代表电影专家组。

Thinking about JPEG image files, you may have also heard of MPEG video files. The file-name extensions “.jpg” and “.mpg” on your computer are their abbreviations. These are industry-standard electronic file compression methods. JPEG stands for Joint Photographic Experts Group and MPEG stands for Motion Picture Experts Group.


小波有很多种类型。一种类型来自数学方程,而另一种类型由基本小波滤波器构建,只有两个点(两个样本值)。Daubechies 4、Daubechies 20 和双正交小波是第二种类型的例子。图 7-7 显示了连续 Daubechies 4 小波的 768 点近似值,其中四个滤波器点(加上 2 个零值点)叠加。

There are many types of wavelets. One type comes from mathematical equations while a second type is built from basic wavelet filters having as little as two points (two sample values). The Daubechies 4, Daubechies 20, and biorthogonal wavelets are examples of this second type. Figure 7-7 shows a 768-point approximation of a continuous Daubechies 4 wavelet with the four filter points (plus 2 zero-valued points) superimposed.

Image

图 7-7Daubechies 4 小波,具有 4 个原始滤波点和 2 个零值端点。

Figure 7-7 Daubechies 4 wavelet with four original filter points and two zero-valued end points.

一些小波具有对称性(在人类视觉感知中很有价值),例如双正交小波对。Shannon 或 Sinc 小波可以找到具有特定频率的事件。Haar 小波(最短的)适用于边缘检测和重建二进制脉冲。Coiflet 小波适用于具有自相似性(分形)的信号数据,例如金融趋势。一些小波族如图 7-8 所示。

Some wavelets have symmetry (valuable in human vision perception) such as the biorthogonal wavelet pairs. Shannon or Sinc wavelets can find events with specific frequencies. Haar wavelets (the shortest) are good for edge detection and reconstructing binary pulses. Coiflet wavelets are good for signal data with self-similarities (fractals) such as financial trends. Some of the wavelet families are shown in Figure 7-8.

Image

图 7-8小波族的示例。

Figure 7-8 Examples of wavelet families.

如果需要,您甚至可以创建自己的小波。然而,在许多已经存在并准备好使用的小波中,存在着财富的尴尬(太多的好东西)。我们已经看到,由于小波具有拉伸和移动的能力,因此具有极强的适应性。您通常可以通过选择不太完美的小波来很好地度过难关。唯一错误的选择是避免小波,因为小波选择过多。

You can even create your own wavelets, if needed. However, there is an embarrassment of riches (too much of a good thing) in the many wavelets that are already out there and ready to use. We have already seen that, with their ability to stretch and shift, wavelets are extremely adaptable. You can usually get by very nicely with choosing a less-than-perfect wavelet. The only wrong choice is to avoid wavelets due to an overabundance of wavelet choices.

学习和正确使用小波来处理具有异常或在特定时间频率突然变化的迷人现实世界信号所花费的时间将得到丰厚的回报。有关 wavelets 的更多信息,请访问 http://www.ConceptualWavelets.com

The time spent in learning and correctly using wavelets for the fascinating real-world signals that have anomalies, or sudden changes in frequency at specific times, will be handsomely repaid. More information on wavelets can be found at http://www.ConceptualWavelets.com.

您应该记住什么

What You Should Remember

本章中应记住的概念是:

The concepts you should remember from this chapter are:

• 小波变换(小波)是一种数学过程,允许我们确定数字真实世界信号的频谱,这些信号的频率会随时间变化,或者在某些特定时间具有脉冲、异常或其他事件

• Wavelet transforms (wavelets) are mathematical processes allowing us to determine the spectrum of digital real-world signals having frequencies that change over time or have pulses, anomalies, or other events at certain specific times.

• 小波使我们能够检测数字信号中的小幅度不连续性和其他隐藏事件。

• Wavelets allow us to detect small amplitude discontinuities and other hidden events in digital signals.

• 小波也用于图像压缩,几乎存在于所有现代数码相机和手机中。

• Wavelets are also used for image compression and are found in almost every modern digital camera and cell phone.

• 有许多不同类型的小波变换。他们都伸展和移动,适应性很强。但是,对于特定应用程序,一种类型可能比另一种类型更好(双正交用于图像,Haar 用于短事件,Daubechies 20 用于线性调频信号,Shannon 用于精确频率确定,等等)。

• There are many different types of wavelet transforms. They all stretch and shift and are very adaptable. However, one type may be better than another for a particular application (biorthogonal for images, Haar for short events, Daubechies 20 for chirp signals, Shannon for precise frequency determination, and so on).

8. 数字滤波器

8. Digital Filters

在前面的章节中,我们提到了过滤模拟和数字信号的想法。由于滤波是所有语音通信、音乐和视频信号处理系统中的关键操作,因此让我们详细了解滤波器和滤波。

In previous chapters, we mentioned the idea of filtering analog and digital signals. Because filtering is a crucial operation in all voice communications, music, and video signal processing systems, let’s learn more about filters and filtering.

过滤器这个词的含义正是您可能期望的 — 允许某些事物通过并阻止其他事物的设备。例如,电动咖啡机中的滤纸允许水通过,但会堵塞咖啡渣。汽车中的空气过滤器允许空气通过汽车的发动机,但会阻挡任何灰尘颗粒。

The word filter means just what you might expect—a device that allows certain things to pass through and blocks other things. For example, the paper filter in your electric coffee maker allows water to pass through but blocks the coffee grounds. The air filter in your automobile allows air to pass through to your car’s engine but blocks any dust particles.

让我们来谈谈允许某些信号频率通过并阻挡其他信号频率的电子滤波器,而不是水或空气。在模拟信号处理中,模拟滤波器接受输入模拟电压信号,该信号包含各种频率的任意数量的能量,并且只允许特定频率范围内的信号能量通过。在数字信号处理中,数字滤波器接受输入数字信号序列(数字列表),该序列包含各种频率的任意数量的能量,并且只允许特定频率范围内的信号能量通过。例如,我们的语音信号可能被高频噪声污染。将嘈杂的信号通过滤波器可以消除噪声并产生干净(未受污染)的语音信号。让我们通过查看模拟和数字滤波器的示例来阐明这种过滤概念。

Instead of water or air, let’s talk about electronic filters that allow certain signal frequencies to pass and block other signal frequencies. In analog signal processing, an analog filter accepts an input analog voltage signal that contains some arbitrary amount of energy at various frequencies and only allows signal energy within a certain frequency range to pass through. In digital signal processing, a digital filter accepts an input digital signal sequence (a list of numbers) that contains some arbitrary amount of energy at various frequencies and only allows signal energy within a certain frequency range to pass through. For example, we may have a voice signal that is contaminated with high-frequency noise. Passing that noisy signal through a filter can eliminate the noise and yield a clean (uncontaminated) voice signal. Let’s clarify this idea of filtering by looking at examples of both analog and digital filters.

模拟滤波

Analog Filtering

模拟滤波器是安装在印刷电路板上的互连电子硬件组件的集合。这些滤波器接受模拟电压信号作为输入,并产生改变的模拟电压信号作为输出。

Analog filters are a collection of interconnected electronic hardware components mounted on a printed circuit board. These filters accept analog voltage signals as inputs and produce altered analog voltage signals as outputs.

作为模拟滤波的一个示例,假设工程师想要构建一个频率为 3 kHz (3,000 Hz) 的模拟正弦波发生器。但由于硬件组件的缺陷,工程师的发电机输出电压是一个严重失真的模拟信号,如图 8-1(a) 所示。使用模拟频谱分析仪查看失真的正弦波频谱,显示所需的 3 kHz 正弦波信号受到频率为 5 kHz 和 7 kHz 的不需要的频谱分量的污染,如图 8-1(b) 所示。

As an example of analog filtering, let’s say an engineer wants to build an analog sine wave generator whose frequency is 3 kHz (3,000 Hz). But due to hardware component imperfections, the engineer’s generator output voltage is a badly distorted analog signal as shown in Figure 8-1(a). Looking at the distorted sine wave’s spectrum using an analog spectrum analyzer shows the desired 3 kHz sine wave signal is contaminated with undesired spectral components whose frequencies are 5 kHz and 7 kHz as presented in Figure 8-1(b).

Image

图 8-1失真的 3 kHz 模拟正弦波:(a) 失真的正弦波电压;(b) 失真的正弦波谱;(c) 低通滤波,以产生不失真的 3 kHz 模拟正弦波信号。

Figure 8-1 A distorted 3 kHz analog sine wave: (a) distorted sine wave voltage; (b) distorted sine wave spectrum; (c) lowpass filtering to produce an undistorted 3 kHz analog sine wave signal.

工程师的正弦波生成问题的一种解决方案是将失真的正弦波电压施加到模拟低通滤波器上,该滤波器通过所需的 3 kHz 频谱能量并阻挡高频 5 kHz 和 7 kHz 频谱能量。此方案如图 8-1(c) 所示。

One solution to the engineer’s sine wave generation problem is to apply the distorted sine wave voltage to an analog lowpass filter that passes the desired 3 kHz spectral energy and blocks the higher-frequency 5 kHz and 7 kHz spectral energy. This scenario is shown in Figure 8-1(c).

如果您还记得,我们已经讨论了模拟低通滤波器的一种应用。这是第 5 章图 5-25(b) 数字信号频谱分析示例中的模拟低通抗混叠滤波器。

If you recall, we’ve already discussed one application of an analog lowpass filter. That was the analog lowpass anti-aliasing filter in Chapter 5’s Figure 5-25(b) digital signal spectrum analysis example.

通用筛选器类型

Generic Filter Types

图 8-1(c) 中的滤波器称为低通滤波器,因为它通过低频并阻挡高频。我们将通用低通滤波器的特性显示为图 8-2(a) 中的频域曲线。该曲线的 passband 是将通过滤波器的信号的频率范围。曲线的 stopband 是将被阻止通过滤波器的信号的频率范围。对于图 8-1(c) 中的低通滤波器,3 kHz 位于低通滤波器的通带中,5 kHz 和 7 kHz 位于滤波器的阻带中。

The filter in Figure 8-1(c) is called a lowpass filter because it passes low frequencies and blocks high frequencies. We show the characteristic of a generic lowpass filter as the frequency-domain curve in Figure 8-2(a). The passband of that curve is the frequency range of signals that will pass through the filter. The stopband of the curve is the frequency range of signals that will be blocked from passing through the filter. For our lowpass filter in Figure 8-1(c), 3 kHz is in the passband of the lowpass filter, and 5 kHz and 7 kHz are in the stopband of the filter.

Image

图 8-2通用滤波器频域行为:(a) 低通滤波器;(b) 高通滤波器。

Figure 8-2 Generic filter frequency-domain behavior: (a) lowpass filter; (b) highpass filter.

高通滤波器的频域特性如图 8-2(b) 所示。该图向我们展示了高通滤波器允许高频信号通过,而它阻止了低频信号。

The frequency-domain behavior of a highpass filter is shown in Figure 8-2(b). This figure shows us that a highpass filter allows high-frequency signals to pass through, while it blocks low-frequency signals.

信号处理中还使用了另外两种类型的滤波器:带通滤波器带阻滤波器。这些滤波器类型的频域行为如图 8-3 所示。带通滤波器在两个阻带之间具有通带,而阻带滤波器在两个通带之间具有阻带。

There are two other types of filters used in signal processing: bandpass filters and bandstop filters. The frequency-domain behavior of these filter types is shown in Figure 8-3. Bandpass filters have a passband between two stopbands, while stopband filters have a stopband between two passbands.

Image

图 8-3通用滤波器频域行为:(a) 带通滤波器;(b) 带阻滤波器。

Figure 8-3 Generic filter frequency-domain behavior: (a) bandpass filter; (b) bandstop filter.

请务必注意,上述四种通用滤波器类型及其特定的通带和阻带位置可以作为模拟或数字滤波器实现。

It’s important to note that the four generic filter types described above, with their specific passband and stopband locations, can be implemented as either analog or digital filters.

数字滤波

Digital Filtering

数字滤波器具有模拟滤波器的所有行为特性,但有两个例外:首先,数字滤波器对数字信号(数字序列)进行操作;其次,数字滤波器是算术运算,而不是电子硬件组件。我们通过在图 8-4 中显示数字信号低通滤波过程来说明这些异常,其中对有噪声的数字 3 kHz 正弦波信号进行滤波以产生干净的正弦波数字信号。也就是说,对输入数字信号数字序列执行算术运算,以生成一个新的数字信号序列,我们将其视为数字滤波器的输出。现在让我们展示一个简单、真实的数字低通滤波示例的算术细节。

Digital filters share all the behavioral characteristics of analog filters, with two exceptions: first, digital filters operate on digital signals (sequences of numbers); second, digital filters are arithmetic operations rather than electronic hardware components. We illustrate these exceptions by showing a digital signal lowpass filtering process in Figure 8-4, where a noisy digital 3 kHz sine wave signal is filtered to produce a clean sine wave digital signal. That is, arithmetic operations are performed on the input digital signal sequence of numbers to generate a new digital signal sequence of numbers that we treat as the output of the digital filter. Let’s now show the arithmetic details of a simple, real-world digital lowpass filtering example.

Image

图 8-4失真的 3 kHz 数字正弦波信号的数字低通滤波。

Figure 8-4 Digital lowpass filtering of a distorted 3 kHz digital sine wave signal.

医生喜欢获得患者的准确血压读数。除了定期测量血压读数外,您的医生还可能寻找任何趋势,例如血压在一年内缓慢上升。单个血压读数会产生医生感兴趣的两个数字,即收缩压和舒张压值。但是,对于这个数字滤波示例,我们将只关注第一个数字,即收缩压。

Doctors like to obtain their patients’ accurate blood pressure readings. In addition to taking periodic blood pressure readings, your doctor might be looking for any trends such as a slow rise of blood pressure over, say, a year’s time. A single blood pressure reading produces two numbers of interest to a doctor, the systolic and diastolic blood pressure values. However, for this digital filtering example we’ll focus only on the first number, the systolic blood pressure.

图 8-5(a) 显示了每天 365 个收缩压读数的假设序列。该序列是一个数字信号,为了清楚起见,我们用直线而不是点来绘制它。

Figure 8-5(a) shows a hypothetical sequence of 365 daily systolic blood pressure readings. That sequence is a digital signal and, for clarity, we plot it with straight lines rather than using dots.

Image

图 8-5血压读数: (a) 原始读数;(b) 平均 4 个结果。

Figure 8-5 Blood pressure readings: (a) original readings; (b) averaged-by-4 results.

在这里很难发现任何长期的血压趋势,因为读数值波动很大,从 101 到 166 不等。前四个读数是 148、107、139 和 133。如果我们对前四个值求平均值,则得到 132 的结果。如果我们对第 2 次、第 3 次、第 4 次和第 5 次读数求平均值,则得到 124 的结果。当我们对第 3 个、第 4 个、第 5 个和第 6 个读数求平均值时,我们得到的结果为 129。让我们继续这个过程,对全年的四个递增的连续读数进行平均。这种对四个压力值的连续组求平均值的算术过程称为移动平均器,是低通滤波信号数据的一种方法。图 8-5(b) 显示了使用这个四点移动平均器的结果。

It’s pretty hard to spot any long-term blood pressure trends here because the reading values fluctuate so much, ranging from 101 to 166. The first four readings are 148, 107, 139, and 133. If we average those first four values, we obtain a result of 132. If we average the 2nd, 3rd, 4th, and 5th readings, we obtain a result of 124. When we average the 3rd, 4th, 5th, and 6th readings, we obtain a result of 129. Let’s continue this process of averaging sets of four incremented successive readings for the whole year. This arithmetic process of averaging successive groups of four pressure values is called a moving averager and is one method of lowpass filtering signal data. Figure 8-5(b) shows the results of using this four-point moving averager.

我们可以看到图 8-5(b) 中的平均值略微平滑,其中值波动减少。然而,医生仍然很难发现血压读数的任何长期趋势。如果我们对更多的连续读数进行平均,我们将获得更好的平滑。对第 1 个到第 16 个读数、第 2 个到第 17 个读数、第 3 个到第 18 个读数进行平均,依此类推,将生成图 8-6(a) 中所示的值序列。在那里,我们看到了进一步的数据值平滑,在这种情况下,医生可以开始看到血压读数的上升趋势。我们这里做的是对原始血压数据序列进行低通滤波,以减少其高频值的波动。

We can see a little smoothing of the averaged values in Figure 8-5(b) where the value fluctuations are reduced. However, a doctor would still be hard pressed to spot any long-term trend in blood pressure readings. If we average a larger number of successive readings, we would achieve better smoothing. Averaging the 1st through the 16th readings, the 2nd through the 17th readings, the 3rd through the 18th readings, and so on produces the sequence of values shown in Figure 8-6(a). There we see further data-value smoothing, in which case a doctor can begin to see an upward trend in blood pressure readings. What we are doing here is lowpass filtering the original blood pressure data sequence to reduce its high frequency value fluctuations.

Image

图 8-6血压读数: (a) 平均 16 个结果;(b) 平均 64 个结果。

Figure 8-6 Blood pressure readings: (a) averaged-by-16 results; (b) averaged-by-64 results.

更进一步,我们可以在 64 个连续样本的连续组中平均我们的原始血压读数。也就是说,对第 1 个到第 64 个读数、第 2 个到第 65 个读数、第 3 个到第 66 个读数进行平均,依此类推。这样做会产生图 8-6(b) 所示的曲线。现在,读数值明显平滑,医生可以很容易地检测到一年内血压的升高。同样,这种长期上升趋势在图 8-5(a) 所示的原始血压读数中并不明显。

Going further, we can average our original blood pressure readings in successive sets of 64 contiguous samples. That is, averaging the 1st through the 64th readings, the 2nd through the 65th readings, the 3rd through the 66th readings, and so on. Doing this results in the curve shown in Figure 8-6(b). The reading values are now significantly smoothed and a doctor can easily detect increasing blood pressure over the period of one year. Again, this long-term upward trend was not noticeable in the original blood pressure readings shown in Figure 8-5(a).

在本节的开头,我们指出数字滤波器本质上是算术运算。上面讨论的血压数值平均运算是数字低通滤波的形式。重要的是要认识到,有许多不同的算术方法可以实现数字滤波,有些方法比其他方法更复杂。上面描述的 moving averager 数字滤波器是所有数字滤波器实现中最简单的。

At the beginning of this section, we stated that digital filters are essentially arithmetic operations. And the blood pressure numerical averaging operations discussed above are forms of digital lowpass filtering. It’s important to realize that there are many different arithmetic methods to implement digital filtering, some more complicated than others. The moving averager digital filter described above is the simplest of all digital filter implementations.

您应该记住什么

What You Should Remember

本章中应记住的概念是:

The concepts you should remember from this chapter are:

• 滤波器用于消除输入信号中不需要的频谱频率。

• Filters are used to eliminate unwanted spectral frequencies in an input signal.

• 模拟滤波器是互连电子硬件组件的集合,在模拟电压下工作。模数转换通常先进行模拟低通滤波。

• An analog filter, a collection of interconnected electronic hardware components, operates on analog voltages. Analog-to-digital conversion is often preceded by analog lowpass filtering.

• 数字滤波器是一种算术过程,对数值数据序列进行操作。

• A digital filter, an arithmetic process, operates on sequences of numerical data.

• 在当今的电子系统中,有许多类型的专用滤波器,包括模拟滤波器和数字滤波器。

• There are many types of specialized filters, both analog and digital, in wide use in today’s electronic systems.

9. 二进制数

9. Binary Numbers

在前面的章节中,我们反复指出,模数转换器生成的数字信号只是数字序列,如图 9-1 所示。

In previous chapters, we’ve repeatedly stated that a digital signal generated by an analog-to-digital converter is merely sequences of numbers, as shown in Figure 9-1.

Image

图 9-1数字信号生成。

Figure 9-1 Digital signal generation.

具体来说,构成数字信号的数字并不是我们在日常生活中处理的普通十进制数字。数字信号中的数字称为二进制,本章介绍使用二进制数的特性、用途和必要性。

To be specific, the numbers comprising a digital signal are not the normal decimal numbers that we deal with in our daily lives. The numbers in a digital signal are called binary numbers and this chapter describes the characteristics, utility, and necessity of using binary numbers.

数字系统

Number Systems

如果我们首先回顾一下我们在小学学到的关于十进制数的知识,就很容易理解二进制数的性质。让我们这样做。

Understanding the nature of binary numbers is easy if we first recall what we learned about decimal numbers in grade school. Let’s do that.

十进制数,一种以 10 为基数的数字系统

Decimal Numbers, a Base-10 Number System

在我们的十进制数字系统中,我们有 10 位数字,从 0 到 9,我们可以使用一系列十进制数字来表示任何整数,如图 9-2 所示。在该图中,我们显示了十进制数 1203,即 1203。图 9-2(a)9-2(b) 提醒我们 4 位数字中每个十进制数字的值。单个数字的值取决于它在 4 位数字中的位置或位置。例如,我们数字中的“2”位数字的值不是 2。我们号码中的“2”位数字值为 200。也就是说,“2” 的值取决于它在多位数十进制数中的位置。这种方案称为写数字的位值系统。

In our decimal number system, we have 10 digits, 0 through 9, and we can represent any whole number using a series of decimal digits as shown in Figure 9-2. In that figure, we show the decimal number 1203, one thousand two hundred and three. Figures 9-2(a) and 9-2(b) remind us of the values of each decimal digit in our 4-digit number. The value of a single digit depends on its place, or position, within the 4-digit number. For example, the value of the “2” digit in our number is not 2. The value of the “2” digit in our number is 200. That is, the value of the “2” depends on its place within a multidigit decimal number. This scheme is called a place-value system of writing numbers.

Image

图 9-2十进制数 120310 的数字值。

Figure 9-2 Digit values of the decimal number 120310.

我们使用图 9-2(c) 中下标的 10,120310,来提醒我们数字 1203 是一个十进制数。图 9-2 中的数字概念对我们来说是如此熟悉,以至于我们在日常生活中毫不费力地使用它们。

We use the subscripted 10 in Figure 9-2(c), 120310, to remind us that our number 1203 is a decimal number. The numerical concepts in Figure 9-2 are so familiar to us that we use them effortlessly in our everyday life.

数学家将我们熟悉的图 9-2 十进制数字系统称为以 10 为基数的数字系统,因为它有 10 个不同的数字,从 0 到 9。

Mathematicians refer to our familiar Figure 9-2 decimal number system as a base-10 number system because it has 10 different digits, 0 through 9.

以 4 为基数的数字系统

A Base-4 Number System

为了加强我们对写数字的位值方法的理解,在准备讨论二进制数时,让我们考虑一个假设的 4 进制数字系统,它只有 0 到 3 的四位数字。使用图 9-2 中相同的位值概念,图 9-3 向我们展示了如何在以 4 为基数的数字系统中解释数字 12034

To reinforce our understanding of the place-value method of writing numbers, in preparation for discussing binary numbers, let’s consider a hypothetical base-4 number system that has only four digits, 0 through 3. Using the same place-value concepts in Figure 9-2, Figure 9-3 shows us how to interpret the number 12034, in a base-4 number system.

Image

图 9-3以 4 为基数的数字值 12034.

Figure 9-3 Digit values of the base-4 number 12034.

我们的 12034 数字中的“2”位值是 2 乘以 4 的平方,即 2 乘以十进制 16。我们的 12034 数字中的“1”位数字的值是 1 乘以 4 的立方,1 乘以十进制 64。图 9-3(c) 显示我们以 4 为 12034 为基数的十进制值是 9910。如果您理解图 9-29-3 中的数字表示法约定,请拍拍自己的后背。你越来越精通位值数字系统的数学。

The value of the “2” digit in our 12034 number is 2 times 4 squared—that is, 2 times decimal 16. The value of the “1” digit in our 12034 number is 1 times 4 cubed, 1 times decimal 64. Figure 9-3(c) shows us that the decimal value of our base-4 12034 number is 9910. If you understand the numerical notation conventions in Figures 9-2 and 9-3, pat yourself on the back. You’re becoming well-versed in the mathematics of place-value number systems.


顺便一提

By the Way

表示数字的位值系统非常古老 — 事实上,它是如此古老,以至于它的起源非常模糊。然而,由于其固有的单位数字定位为最右边的数字,这个数字系统是如此方便和强大,以至于它的重要性被比作第一个字母表。

The place-value system of representing numbers is very old—so old, in fact, that its origin is obscure. However, with its inherent positioning of the units digit as the right-most digit, this number system is so convenient and powerful that its importance has been compared to that of the first alphabets.


二进制数,一种以 2 为基数的数字系统

Binary Numbers, a Base-2 Number System

二进制数系统(所有计算机、手机、光盘和手动计算器都使用)是一个以 2 为基数的系统,只有两位数字,即 0 和 1。(二进制一词来自拉丁语 binarius,意思是由两个组成;例如,自行车、双语和双筒望远镜。

The binary number system—used by all computers, cell phones, compact discs, and hand calculators—is a base-2 system that has only two digits, 0 and 1. (The word binary comes from the Latin word binarius, which means consisting of two; for example, bicycle, bilingual, and binoculars.)

作为二进制数示例,图 9-4 表示二进制数 11012,其中图 9-4(a)图 9-4(b) 显示了二进制数中每个数字的十进制值。图 9-4(c) 显示我们的二进制数 11012 的十进制值为 1310。我们使用了图 9-4 中的下标 2 来清楚地表明我们的数字 11012 是一个二进制数;一个以 2 为基数的数字系统。(经常使用二进制数的硬件和软件工程师不会费心使用 2 下标。

As a binary number example, Figure 9-4 presents the binary number 11012, where Figure 9-4(a) and Figure 9-4(b) show the decimal value of each digit in the binary number. Figure 9-4(c) shows us that our binary number 11012 has a decimal value of 1310. We used the subscripted 2 in Figure 9-4 to make clear that our number 11012 is a binary number; a base-2 number system. (Hardware and software engineers who routinely work with binary numbers don’t bother using the 2 subscript.)

Image

图 9-4二进制(以 2 为基数)的数字值 11012.

Figure 9-4 Digit values of the binary (base-2) number 11012.

表 9.1 显示了前 16 个二进制数及其等效的十进制值。表左列中的数字称为 4 位二进制数,因为它们每个都有 4 个二进制数字。(0 或 1 的单个二进制数字)是二进制数中的最小信息单位。

Table 9.1 shows the first 16 binary numbers and their equivalent decimal values. The numbers in the table’s left column are called 4-bit binary numbers because they each have 4 Binary digits. A bit, a single binary digit of either 0 or 1, is the smallest unit of information in a binary number.

Image

表 9.1前 16 个二进制数

Table 9.1 First 16 Binary Numbers

尽管它们看起来很奇怪,但二进制数与我们的十进制数一样有用和实用。任何十进制数都可以写入二进制数系统。图 9-5 显示了如何将十进制数 1234 写为二进制数。123410 = 100110100102.我们对十进制数执行的所有算术运算也可以对二进制数执行,例如加法、减法、乘法和除法。

As strange as they look, binary numbers are just as useful and practical as our decimal numbers. Any decimal number can be written in the binary number system. Figure 9-5 shows how to write the decimal number 1234 as a binary number. 123410 = 100110100102. All of the arithmetic operations that we perform on decimal numbers can also be performed on binary numbers, such as addition, subtraction, multiplication, and division.

我们在这里演示的是,二进制位序列(1 和 0)可用于表示十进制数。在这种情况下,我们将这样的二进制位序列称为二进制数。但是,正如我们在下一节中讨论的那样,我们可以使用二进制位来表示其他类型的信息。

What we’re demonstrating here is that a sequence of binary bits (ones and zeros) can be used to represent a decimal number. And in that context, we call such a sequence of binary bits a binary number. However, as we discuss in the next section, we can use binary bits to represent other types of information.

Image

图 9-5二进制数等同于十进制数 1234。

Figure 9-5 Binary number equivalent of the decimal number 1234.


顺便一提

By the Way

现在你能够理解计算机极客的笑话了,“只有 10 种人 - 那些懂二进制数的人,和那些不懂的人。

Now you’re able to understand the computer geek joke, “There are only 10 kinds of people—those who understand binary numbers, and those who don’t.”


事实证明,有许多不同的方法可以用二进制位序列来表示十进制数。对于感兴趣的读者,这些表示形式(称为二进制数字格式)在附录 D 中提供。

As it turns out, there are a number of different ways to represent decimal numbers with sequences of binary bits. For the interested reader, those representations, known as binary number formats, are presented in Appendix D.

在家中使用二进制数

Using Binary Numbers at Home

让我们用一个生日派对的例子来说明二进制数系统是如何工作的。如果你正在庆祝某人的 21 岁生日,而且只有 5 支蜡烛,那么就没有必要跑到商店买更多的蜡烛:二进制数字来拯救。您只需按照图 9-6 所示布置和点燃蜡烛。点燃的蜡烛表示二进制 1 位,未点燃的蜡烛表示二进制 0 位。这样,您的五根蜡烛代表十进制数字 21。然后,您可以向生日派对客人解释二进制数,并自豪地宣布:“我们这个家庭经常使用二进制数系统。

Let’s use an example of a birthday party to show how the binary number system works. If you’re celebrating someone’s twenty-first birthday and only have five candles, there’s no need to run to the store for more candles: binary numbers to the rescue. You merely arrange and light the candles as shown in Figure 9-6. A lit candle represents binary one bit and an unlit candle represents binary zero bit. This way, your five candles represent the decimal number 21. You can then explain binary numbers to your birthday party guests and proudly announce, “We often use the binary number system in this household.”

Image

图 9-6用五根蜡烛和二进制数字庆祝 21 岁生日。

Figure 9-6 Celebrating a twenty-first birthday with five candles and binary numbers.


顺便一提

By the Way

使用二元生日蜡烛技术意味着您只需要七根蜡烛。七支点燃的蜡烛,11111112 = 12710,让您能够庆祝 127 岁以下的生日。(这甚至会涵盖本书作者的年龄!

Using the binary birthday candle technique means that all you’ll ever need are seven candles. Seven lit candles, 11111112 = 12710, enable you to celebrate birthdays up to the age of 127 years. (This would cover even the ages of the authors of this book!)


二进制数据

Binary Data

二进制位的一个非常常见的应用是使用它们来表示字母。例如,Table 9.2 列出了使用 8 个二进制位表示小写英文字母的行业标准约定。

A very common application of binary bits is to use them to represent letters. For example, Table 9.2 lists the industry-standard convention for representing lowercase English letters using 8 binary bits.

Image

表 9.2小写英文字母的行业标准二进制数据约定

Table 9.2 Industry-Standard Binary Data Convention for Lowercase English Letters

因此,如果您使用计算机的文字处理软件创建单词 cat 并决定在打印机上打印该单词,则计算机会通过电缆将三个 8 位二进制数据字 01100011、01100001 和 01110100 发送到打印机。反过来,您的打印机设计为将这三个二进制单词解释为英文字母 c a t,然后打印出来。

So if you use your computer’s word-processing software to create the word cat and decide to print that word on your printer, your computer sends the three 8-bit binary data words 01100011, 01100001, and 01110100 by way of a cable to your printer. In turn, your printer is designed to interpret those three binary words as the English letters c a t, which it then prints.


顺便一提

By the Way

8 个二进制位的序列称为字节。因此,如果您有一张文件大小为 50 KB(50,000 字节)的数码照片,则该照片的文件包含 400,000 个二进制位。同样,一个 8 GB 的硬盘驱动器可以存储大约 640 亿个二进制比特。在你问之前,是的,有一个 nibit。它是半字节或 4 位。

A sequence of 8 binary bits is called a byte. So if you have a digital photo whose file size is 50 kilobytes (50,000 bytes), that photo’s file contains 400,000 binary bits. Likewise, an 8-gigabyte hard disk drive can store approximately 64 billion binary bits. And before you ask, yes, there is a nibble. It’s half a byte, or 4 bits.


对于二进制数据的另一个示例,在高清电视 (HDTV) 中,电视屏幕上的每个微小彩色点(称为像素,简称图片元素)都由三个 8 位二进制字控制。每个 8 位二进制字表示红色、蓝色和绿色的光强度级别,这些颜色组合在一起以定义单个像素的最终颜色。

For another example of binary data, in a high-definition television (HDTV), each tiny colored dot (called a pixel, short for picture element) on the television screen is controlled by three 8-bit binary words. Each 8-bit binary word represents the light intensity level of red, blue, and green colors that are combined to define the final color of a single pixel.

为什么使用二进制数?

Why Use Binary Numbers?

乍一看,我们有理由问为什么我们要用这个显然非常有限的二进制数系统来表示我们的十进制数。答案在于构建可以表示 1 和 0 两个二进制数字的电路的实用性。

At first glance, it’s reasonable to ask why in the world would we use this apparently very limited binary number system to represent our decimal numbers. The answer lies in the practicality of building electric circuits that can represent the two binary digits of 1 and 0.

数字硬件易于构建

Digital Hardware Is Easy to Build

尽管我们功能强大且复杂,但我们在数字硬件中使用电气开关来表示 1 或 0 的二进制数字。我们所说的电开关是指与墙上的电灯开关完全相同的功能。也就是说,如果 switch 打开(关闭),我们将其解释为表示二进制 0 位。如果 switch 闭合 (on),我们将其解释为表示 1 的二进制位。(甚至许多现代电器上的电源开关也被标记为 1/0 而不是 On/Off。因此,为了在硬件中表示任意 8 位二进制字,我们组装了一组 8 个 switch,每个 switch 要么是打开的,要么是关闭的。然而,我们使用的开关并不是墙上那些熟悉的电灯开关。在计算机硬件中,我们的开关是极小的晶体管,可以制造数百万个晶体管)作为单个集成电路芯片),即封装在小型塑料或陶瓷块中的互连(集成)晶体管的小型集合。数字工程师将这些晶体管开关称为具有两种状态,打开或关闭。

For all our power and sophistication, we use electric switches in digital hardware to represent a binary digit of 1 or 0. By electric switch we mean exactly the same function as the electric light switch on a wall. That is, if the switch is open (off), we interpret that to represent a binary 0 bit. And if the switch is closed (on), we interpret that to represent the binary bit of 1. (Even the power switches on many modern electrical appliances are labeled 1/0 instead of On/Off.) As such, to represent an arbitrary 8-bit binary word in hardware, we assemble a set of eight switches, each of which are either open or closed. However, the switches we use are not those familiar electrical light switches on a wall. In computer hardware, our switches are extremely small transistors, many millions of which can be fabricated) as a single integrated circuit (a chip), a miniaturized collection of interconnected (integrated) transistors encapsulated in a small plastic or ceramic block. Digital engineers refer to these transistor switches as having two states, either opened or closed.

可以构建一个可靠的 0 到 9 电路,它具有 10 种状态,因此它可以表示 0 到 9 的 10 位十进制数字。但出于许多实际工程原因,此类电路的成本将远远高于二进制电路。普通人永远买不起家用电脑、手机或用十进制电路构建的高清电视。

A reliable 0 to 9 electric circuit that has 10 states, so it can represent the 10 decimal digits of 0 to 9, could be built. But for a number of practical engineering reasons, the cost of such circuits would be far greater than binary circuits. The average person could never afford to buy a home computer, cell phone, or high-definition television built with decimal-like circuits.


顺便一提

By the Way

由于单个晶体管的 On/Off 状态可以表示二进制位、0 或 1,因此晶体管用于计算机内存中的数据存储。家用计算机的 USB 闪存驱动器(拇指驱动器)存储设备包含数十亿个晶体管。2002 年,研究此类事物的电子行业分析师估计,当年生产的晶体管比米粒还多,一粒米的成本可以购买数百个晶体管。令人震惊的是,在 2009 年,每粒米生产了 250 多个晶体管,一粒米的成本可以购买 125,000 个晶体管。

Because a single transistor’s On/Off state can represent a binary bit, a 0 or a 1, transistors are used for data storage in a computer’s memory. A home computer’s USB flash drive (thumb drive) memory device contains billions of transistors. In 2002, electronic industry analysts, who study such things, estimated there were more transistors produced that year than grains of rice, and the cost of one rice grain could buy hundreds of transistors. Astoundingly, in 2009 there were more than 250 transistors produced for each grain of rice, and the cost of one rice grain could buy 125,000 transistors.


二进制数据不易降级

Binary Data Is Resistant to Degradation

使用二进制数表示信号的另一个强大优势是二进制数(1 和 0)可以可靠地再现(复制)。让我们用一个例子来解释这个想法。

Another powerful advantage of using binary numbers to represent signals is that binary numbers (ones and zeros) can be reliably reproduced (copied). Let’s explain that idea with an example.

几年前,流行音乐以盒式磁带的形式出售,其中包含两个线轴,上面缠绕着一条薄的磁性涂层塑料磁带。模拟音乐信号由磁带磁性涂层上的磁性强度表示。现在,如果从原始盒式磁带录制第二盒式磁带,则第二代音乐信号的音频质量会有所下降。也就是说,在第二代盒式磁带的音乐背景中可以听到明显的低电平音频嘶嘶声。而且,如果您从第二代盒式磁带录制第三盒式磁带,则不断增加的音频嘶嘶声会使第三代音乐信号的音频质量通常不可接受。

Years ago, popular music was sold in the form of audio cassette tapes containing two spools on which a thin, magnetically coated plastic tape was wound. The analog music signal was represented by the intensity of the magnetism on the tape’s magnetic coating. Now, if you recorded a second cassette tape from an original cassette tape, the second-generation music signal would be somewhat degraded in audio quality. That is, a noticeable low-level audio hiss could be heard in the background of the music on the second-generation cassette tape. And, if you recorded a third cassette tape from a second-generation cassette tape, the ever-increasing amount of audio hiss made the third-generation music signal generally unacceptable in audio quality.

尽管盒式磁带播放器制造商生产双磁带驱动器产品,以便人们可以制作模拟音乐盒式磁带的非法盗版,但这种做法从未变得非常流行。

Although cassette-player manufacturers produced dual-tape-drive products so people could make illegal bootleg copies of analog music cassette tapes, the practice never did become very popular.

不幸的是,对于商业音乐行业来说,随着包含数字(二进制)音乐信号的光盘 (CD) 的出现,这种情况发生了翻天覆地的变化。因为音乐 CD 上的数字信号只不过是二进制 1 和 0 的序列,所以这种二进制数字序列的精确复制是简单可靠的。我们所要做的就是确保 1 不会被复制为 0,反之亦然。由于数字信号可以很容易地复制(复制)而不会出错或降级,因此盗版音乐 CD 具有与复制它们的原始 CD 相同的高保真音频质量。

Unfortunately for the commercial music industry, this situation drastically changed with the advent of compact discs (CDs) containing digital (binary) music signals. Because the digital signals on music CDs are nothing more than sequences of binary ones and zeros, exact duplication of such binary number sequences is simple and reliable. All we have to do is ensure that a one doesn’t get copied as a zero, and vice versa. Because digital signals can easily be copied (reproduced) without error or degradation, bootlegged music CDs have the identical high-fidelity audio quality of the original CDs from which they were copied.

这种对录制、传输和再现过程中信号质量下降的抵抗力就是当今音乐音频、电话音频、Internet 视频和电视视频信号现在作为数字信号实现的原因,而不是过去几年的老式模拟信号。

This resistance to signal-quality degradation during recording, transmission, and reproduction is why today’s music audio, telephone audio, Internet video, and television video signals are now implemented as digital signals rather than the old-fashioned analog signals of years past.

二进制数和模数转换器

Binary Numbers and Analog-to-Digital Converters

正如我们在本章开头所说,二进制数在数字信号处理领域具有特殊意义。这是因为从模数转换器获得的所有数字信号的数值样本值都是二进制数的形式。

As we stated at the beginning of this chapter, binary numbers have a special significance in the field of digital signal processing. That’s because the numerical sample values of all digital signals obtained from analog-to-digital converters are in the form of binary numbers.

例如,在第 4 章中,我们使用图 4-14图 4-15 来说明电话公司如何接受模拟音频按键小键盘信号并将其转换为数字信号(一串数字)。电话公司使用模数转换器,其输出为 8 位二进制数。根据我们现在对二进制数的了解,我们可以绘制一个 8 位数字信号生成过程,如图 9-7 所示。在该图中,我们看到单独的 8 位,其中每个从模数转换器引出的箭头代表一根电线。如果电线上有电压,则该位是二进制 1。如果线路上没有电压,则该位为二进制 0。一组给定的 8 个二进制位表示二进制数系统中的单个数字。

For example, in Chapter 4 we used Figure 4-14 and Figure 4-15 to show how the telephone company accepts an analog audio touch-tone keypad signal and converts it to a digital signal (a sequence of numbers). Telephone companies use analog-to-digital converters whose outputs are 8-bit binary numbers. Given what we now know about binary numbers, we can draw an 8-bit digital signal generation process as shown in Figure 9-7. In that figure, we see the individual 8 bits where each arrow exiting the analog-to-digital converter represents a single electrical wire. If there is a voltage on a wire, then that bit is a binary 1. If there is no voltage on a wire, then that bit is a binary 0. A given set of 8 binary bits represents a single number in the binary number system.

Image

图 9-7数字信号生成显示单个 8 位模数转换器输出位。

Figure 9-7 Digital signal generation showing individual 8-bit analog-to-digital converter output bits.

商用模数转换器的输出范围为 6 位至 24 位。鉴于此,您可能想知道模数转换器应该有多少位才能将模拟信号转换为数字信号。答案在于我们希望数字信号表示模拟信号的准确度。

Commercial analog-to-digital converters are available with outputs that have anywhere from 6 bits to 24 bits. Given that, you might wonder how many bits an analog-to-digital converter should have for converting an analog signal to a digital signal. The answer lies in how accurately we want a digital signal to represent an analog signal.

例如,图 9-8(a) 显示了模拟电压信号被转换为 2 位二进制数字信号,该信号被路由到数模转换器,从而产生最终的模拟电压输出。在该图中,我们可以看到,使用 2 位模数转换器会产生最终输出模拟电压,这是原始输入模拟电压信号的非常粗略版本。另一方面,图 9-8(b) 显示了使用 4 位二进制模数转换器的相同场景。在该图中,我们可以看到,使用 4 位模数转换器产生的最终输出电压与原始输入模拟电压信号有些相似。与仅使用 2 位相比,使用 4 位数字信号提供了更好的性能。

For example, Figure 9-8(a) shows an analog voltage signal being converted to a 2-bit binary digital signal that is routed to a digital-to-analog converter producing a final analog voltage output. In that figure, we can see that using a 2-bit analog-to-digital converter produces a final output analog voltage that is a very crude version of the original input analog voltage signal. On the other hand, Figure 9-8(b) shows the same scenario using a 4-bit binary analog-to-digital converter. In that figure, we can see that using a 4-bit analog-to-digital converter produces a final output voltage that is somewhat similar to the original input analog voltage signal. Using 4-bit digital signals provided improved performance compared to using only 2 bits.

Image

图 9-8使用 2 位和 4 位数字信号的性能:(a) 2 位;(b) 4 位。

Figure 9-8 Performance in using 2- and 4-bit digital signals: (a) 2 bits; (b) 4 bits.

图 9-8(b) 中不稳定的模拟输出模拟信号在某些信号处理应用中可能是可以接受的,但在语音或音乐应用中,仅使用 4 位的数字信号是不可接受的。如果图 9-8(b) 中的模拟输出模拟信号是人声信号,您会听到声音,但您也会听到大量无法忍受的背景音频嘶嘶声(如 AM 收音机上响亮的静电声)。图 9-9 显示了数字信号使用 2 位、4 位、6 位和 8 位二进制数时的图 9-8 转换方案。在该图中,我们看到 8 位模数转换提供的输出模拟电压与原始输入模拟信号非常相似。这就是为什么 8 位模数转换被认为适用于固定电话的原因。

The choppy analog output analog signal in Figure 9-8(b) may be acceptable in some signal processing applications, but using only 4 bits for digital signals is unacceptable in voice or music applications. If the analog output analog signal in Figure 9-8(b) was a human voice signal, you would hear the sound of a voice but you’d also hear an intolerable amount of background audio hiss (like the sound of loud static on an AM radio). Figure 9-9 shows the Figure 9-8 conversion scenario when 2-, 4-, 6-, and 8-bit binary numbers are used for the digital signal. In that figure, we see that 8-bit analog-to-digital conversion provides an output analog voltage that’s very similar to the original input analog signal. That’s why 8-bit analog-to-digital conversion is deemed acceptable for landline telephones.

Image

图 9-9用于 2 位、4 位、6 位和 8 位二进制模数转换的输出模拟电压信号质量。

Figure 9-9 Output analog voltage signal quality for 2-, 4-, 6-, and 8-bit binary analog-to-digital conversion.

那么,我们为什么不将 24 位模数转换器用于所有模数转换应用呢?答案是,具有更多位的模数转换器更难构建,购买成本更高。因此,如果应用程序只需要一个 8 位模数转换器即可实现可接受的操作,则无需为不必要的位花费额外的资金。为了进行比较,Table 9.3 提供了各种 signal processing 应用中使用的 binary bits 数量的简短列表。

So why don’t we just use 24-bit analog-to-digital converters for all analog-to-digital conversion applications? The answer is, analog-to-digital converters that have more bits are more difficult to build and more expensive to buy. So if an application only requires an 8-bit analog-to-digital converter for acceptable operation, there’s no need to spend extra money for unnecessary bits. For comparison purposes, Table 9.3 provides a short list of the number of binary bits used in various signal processing applications.

Image

表 9.3数字信号应用和用于表示模拟信号值的位数

Table 9.3 Digital Signal Applications and Number of Bits Used to Represent an Analog Signal Value

您应该记住什么

What You Should Remember

本章中应记住的概念是:

The concepts you should remember from this chapter are:

• 数字信号是数字序列,在数字硬件(计算机、手机、数码相机、高清电视)中,这些数字是二进制数的形式。

• Digital signals are sequences of numbers, and in digital hardware (computers, cell phones, digital cameras, high-definition televisions), those numbers are in the form of binary numbers.

• 二进制数是一个数字序列,其中每个数字只能有两个可能的值 0 和 1 中的一个。单个二进制数字称为位。

• A binary number is a sequence of digits in which each digit can have only one of two possible values, zero and one. A single binary digit is called a bit.

• 二进制数可以用来表示我们非常熟悉的十进制数。

• Binary numbers can be used to represent the decimal numbers that we’re so familiar with.

• 二进制数与我们的日常十进制数具有相同的位值行为。

• Binary numbers have the same place-value behavior as our everyday decimal numbers.

• 二进制位序列还可以表示其他信息,例如字母表中的字母。

• A sequence of binary bits can also represent other information, such as letters of the alphabet.

• 我们在数字硬件中使用二进制数,以保持硬件的可靠性和低廉的成本。

• We use binary numbers in digital hardware to keep the hardware both reliable and inexpensive.

• 用于数字信号采样的位数越多,这些采样值就越精确(更准确)(参见图 9-9)。

• The greater the number of bits used for digital signal samples, the more precise (more accurate) are those sample values (see Figure 9-9).

A. 科学记数法

A. Scientific Notation

科学记数法是工程师和科学家表示非常大和非常小的数字的一种方便而精确的方法。例如,科学概念中写的数字 4,120,000 是 4.12 × 106。科学记数法的规则如图 A-1 所示。

Scientific notation is a convenient and precise way for engineers and scientists to represent very large and very small numbers. For example, the number 4,120,000 written in scientific notion is 4.12 × 106. The rules for scientific notation are given in Figure A-1.

Image

图 A-1科学记数法中的数字 4,120,000。

Figure A-1 The number 4,120,000 in scientific notation.

在此示例中,我们将隐含的小数点从 4,120,000 的右端向左移动了 6 位。通过这样做,我们将大数除以 100,因此我们必须乘以 100,即 10 × 10 × 10 × 10 × 10 × 10 或 106,以保持诚实!

In this example, we moved the implied decimal point from the right end of 4,120,000 six places to the left. By doing this, we divided the large number by one million so we have to multiply by a million, which is 10 × 10 × 10 × 10 × 10 × 10 or 106 to keep ourselves honest!


顺便一提

By the Way

在某些情况下,在无法显示指数(上标)的显示器中,科学记数法 4.12 × 106 显示为 4.12e6。“e”代表指数。

In some cases, in displays that cannot show exponents (superscripts), the scientific notational number 4.12 × 106 is shown as 4.12e6. The “e” stands for exponent.


表 A.1 给出了一些科学记数法的数字示例。

Table A.1 gives a few examples of numbers in scientific notation.

Image

表 A.1科学记数法示例

Table A.1 Scientific Notation Examples

在科学记数法中,很容易将大于 1 的数字转换回其长形式,如图 A-2 所示。写入数字的十进制数字,并将小数点向右移动原始数字的指数指定的位数,并在必要时附加零。

In scientific notation, it’s easy to convert a number that’s greater than 1 back to its long form as we show in Figure A-2. You write the number’s decimal digits and move the decimal point to the right by the number of places specified by the original number’s exponent, appending zeros where necessary.

Image

图 A-2将大于 1 的数字从科学记数法转换为标准长记数法。

Figure A-2 Converting a number greater than 1 from scientific notation to standard long notation.

图 A-3 显示了如何将小于 1 的科学记数法数字转换回其长格式。在那里,我们写入数字的十进制数字,并将小数点向左移动原始数字指数指定的位数,并在必要时插入零。

Figure A-3 shows how to convert a number in scientific notation that’s less than 1 back to its long form. There, we write the number’s decimal digits and move the decimal point to the left by the number of places specified by the original number’s exponent, inserting zeros where necessary.

Image

图 A-3将小于 1 的数字从科学记数法转换为标准长记数法。

Figure A-3 Converting a number less than 1 from scientific notation to standard long notation.

科学记数法可能看起来不太方便,但确实很方便。表 A.2 给出了一些以科学记数法表示的真实物理常数的示例。

Scientific notation may not look too convenient, but indeed it is. Table A.2 gives a few examples of real-world physical constants in scientific notation.

Image

表 A.2科学记数法示例中的物理常数

Table A.2 Physical Constants in Scientific Notation Examples


顺便一提

By the Way

以上所有符号都是严格的英文符号。其他语言具有不同的数字表示法。例如,在德语中,句点和逗号的数字含义与它们在英语中的含义相反。英文数字 3,425,978.64 在德语中写成 3.425.978,64。在我们的英语科学记数法中,这个数字是 3.42597864 × 106

All of the notation above is strictly English notation. Other languages have different numerical notation. For example, in the German language the numerical meanings of periods and commas are reversed from what they mean in English. The English number 3,425,978.64 is written as 3.425.978,64 in German. In our English scientific notation, that number is 3.42597864 × 106.


B. 分贝

B. Decibels

信号处理工程师经常需要测量两个信号之间的幅度差。例如,工程师可能需要将放大器输出端信号的幅度与放大器输入端信号的幅度进行比较。比较这两个信号的幅度描述了放大器的增益(放大量)。然而,在实践中,由于各种信号需要比较的幅度值范围如此之大,工程师发现使用分贝来简化他们的数值比较很方便。本附录介绍了如何执行此操作。

Signal processing engineers often need to measure the amplitude difference between two signals. For example, an engineer might need to compare the amplitude of a signal at the output of an amplifier to the amplitude of that signal at the input of the amplifier. Comparing the amplitude of those two signals describes the gain (the amount of amplification) of the amplifier. In practice, however, because various signals have such a wide range of amplitude values to be compared, engineers find it convenient to use decibels to simplify their numerical comparisons. This appendix describes how this is done.

使用分贝是一种权宜的数学方法,用于比较两个信号之间或任何两个自然现象之间的振幅或功率差异。这听起来可能有点神秘,但您很有可能已经熟悉分贝的使用。我们将介绍两个您已经熟悉的分贝示例,然后讨论信号处理中使用的分贝。

The use of decibels is an expedient mathematical method for comparing the amplitude, or power, difference between two signals or between any two natural phenomena. That may sound a bit mysterious, but there’s a good chance you’re already familiar with use of decibels. We’ll cover two examples of decibels that you are already acquainted with and then discuss decibels as they’re used in signal processing.

在我们提醒您之前遇到的分贝值之前,我们只需要提供一种用于计算用于比较两个数字的分贝值的方程形式。该方程式为:

Before we remind you of decibel values that you’ve encountered before, we simply must present one form of the equation for computing decibel values used to compare two numbers. That equation is:

Image

我们使用字母 dB 来表示单词分贝,就像我们使用字母 mph 来表示单词英里/小时一样。

We use the letters dB to represent the word decibels, much like we use the letters mph to represent the words miles per hour.

不要被方程 (B-1) 所困扰。(我们不会要求您计算任何分贝值;我们将为您进行任何必要的计算。用文字而不是数字表示,方程 (B-1) 是“数字 P1 与数字 P2 相比的分贝值是分数 P1 除以 P2 的以 10 为底的对数的 10 倍。好的,话虽如此,让我们看看您在日常生活中遇到的分贝的用途。

Don’t be troubled by equation (B-1). (We won’t ask you to compute any decibel values; we’ll do any of the necessary calculations for you.) Stated in words rather than numbers, equation (B-1) is “the decibel value of number P1 compared to number P2 is 10 times the base-10 logarithm of the fraction P1 divided by P2.” OK, with that said, let’s look at a use of decibels that you’ve encountered in your daily life.

用于描述声功率值的分贝

Decibels Used to Describe Sound Power Values

声学工程师和一些卫生官员关心测量人们可能接触到的音频的力量。由于我们在日常生活中可能受到的各种声音的功率范围(响度)非常大,因此技术人员使用分贝来对这些声音的功率进行分类。您很可能在某个时候遇到了表 B.1 第三列中列出的声功率值。

Acoustic engineers, and some health officials, are concerned with measuring the power of audio sounds to which people may be exposed. And because the range of power (the loudness) of various sounds we might be subjected to in our daily lives is so large, decibels are used by technical people to categorize the power of those sounds. It’s quite possible that, at one time or another, you have encountered the sound power values listed in the third column of Table B.1.

声学工程师使用他们的音频测试设备来测量特定环境中的声功率值(以瓦特为单位),并将该功率值声明为公式 (B-1) 中的数字 P1。根据音频工程领域的共同协议,0.0000000000001 瓦 (10-12 W) 的值定义为数字 P2。(有关该 10-12 表示法的解释,请参阅附录 A。然后,在等式 (B-1) 中插入数字 P1P2 以计算以 dB 为单位测量的声音值,例如表 B.1 第三列中的值。同样,使用分贝是因为与表 B.1 中笨拙、范围广泛的中心列瓦特数相比,更容易讨论、解释和记录更简单的 dB 值。

Acoustic engineers use their audio test equipment to measure the sound power value (in watts) in a particular environment, and declare that power value as number P1 in equation (B-1). By mutual agreement in the audio engineering field, the value of 0.000000000001 watts (10-12 W) is defined as the number P2. (See Appendix A for an explanation of that 10-12 notation.) Then, numbers P1 and P2 are inserted in equation (B-1) to compute a sound value measured in dB, such as the values in the third column of Table B.1. Again, decibels are used because it’s easier to discuss, interpret, and document the simpler dB values than the clumsy, wide-ranging center-column wattage numbers in Table B.1.

Image

表 B.1常见声音的声学分贝值

Table B.1 Acoustic Decibel Values of Common Sounds

表 B.1 中需要注意的主要一点是,在最右边的列中,10 dB 的差异意味着声功率差因数为 10。这意味着 20 dB 的差异是 100 倍的声功率差异。因此,站在正在运行的割草机 (90 分贝) 附近比站在正在运行的真空吸尘器附近 (70 分贝) 大 100 倍。

The main thing to notice in Table B.1 is that a difference of 10 dB, in the rightmost column, means a sound power difference factor of 10. This means that a difference of 20 dB is a sound power difference by a factor of 100. So standing near a running lawn mower (90 dB) is 100 times louder than standing near a running vacuum cleaner (70 dB).


顺便一提

By the Way

在 20 世纪初,信号处理人员使用以下方程比较两个信号的功率

In the early twentieth century, signal processing people compared the power of two signals using the equation

对数10P1/P2) 贝尔

log10(P1/P2) bels

其中 bel 单位是为了纪念美国电话的发明者亚历山大·格雷厄姆·贝尔 (Alexander Graham Bell) 而命名的。Bel 的单位很快就被发现大得不方便。例如,发现人耳可以检测到十分之一贝尔的音频功率值差异。小于 1 bel 的测量功率值差异非常普遍,以至于导致使用分贝 (bel/10),有效地使 bel 的单位过时。

where the unit bel was named in honor of the American inventor of the telephone, Alexander Graham Bell. The unit of bel was soon found to be inconveniently large. For example, it was discovered that the human ear could detect audio power value differences of one-tenth of a bel. Measured power value differences smaller than one bel were so common that it led to the use of the decibel (bel/10), effectively making the unit of bel obsolete.


让我们看看您可能熟悉的分贝的另一种常见用法。

Let’s look at another common use of decibels that may be familiar to you.

用于测量地震的分贝

Decibels Used to Measure Earthquakes

当您在新闻中听到地球上某处发生地震的消息时,您很可能会听到该地震的总能量由所谓的里氏震级值指定。地震学家还使用对数方程来计算里氏震级值,类似于以 dB 为单位的声功率值。里氏量表方程是

When you hear in the news of an earthquake that has happened somewhere on our planet, you’re likely to hear the total energy of that earthquake specified by a value on what’s called the Richter scale. Seismologists also use a logarithmic equation to compute Richter scale values, similar to our sound power values in dB. That Richter scale equation is

Image

我们不必担心方程 (B-2) 中能量值 E1E2 的含义。我们提出方程 (B-2) 只是为了表明对数的数学运算用于对地震能量进行分类,就像在方程 (B-1) 和表 B.1 中使用对数计算声功率值一样。

We need not worry about the meaning of the energy values E1 and E2 in equation (B-2). We presented equation (B-2) merely to show that the mathematical operation of logarithms is used to categorize earthquake energies in the same way logarithms were used to compute sound power values in equation (B-1) and Table B.1.

表 B.2 列出了地震的常见里氏震级值。表格的中间列根据吨 TNT(类似于炸药)的等效爆炸能量给出了地震总能量的估计值。

Table B.2 presents a list of common Richter scale values for earthquakes. The center column of the table gives an estimate of an earthquake’s total energy in terms of the equivalent explosive energy of tons of TNT (similar to dynamite).

Image

表 B.2里氏量表值和典型效果

Table B.2 Richter Scale Values and Typical Effects

表 B.2 中需要注意的主要一点是,最左列中的里氏值差值为 1,表示能量差因子为 10。这意味着里氏震级差异为 2 是 100 倍的能量差异。因此,8.0 级地震的破坏性是 6.0 级地震的 100 倍。

The main thing to notice in Table B.2 is that a Richter value difference of 1, in the leftmost column, means an energy difference factor of 10. This means that a Richter scale difference of 2 is an energy difference by a factor of 100. So an 8.0 earthquake is 100 times as destructive as a 6.0 earthquake.

表 B.1 的分贝 (dB) 声功率级值类似,与笨拙的宽范围中心列 TNT 能量值相比,讨论、解释和记录表 B.2 的里氏标度值更容易。

Similar to Table B.1’s decibel (dB) sound power level values, it’s easier to discuss, interpret, and document Table B.2’s Richter scale values than the clumsy wide-ranging center column TNT energy values.

好了,现在我们已经熟悉了如何将宽范围数字转换为更简单的较小范围数字,让我们看看信号处理工程师如何执行相同的转换。

OK, now that we’re familiar with converting wide-ranging numbers to simpler smaller-ranging numbers, let’s see how signal processing engineers perform that same conversion.

用于描述信号振幅的分贝

Decibels Used to Describe Signal Amplitudes

正如我们在本附录开头所述,信号处理工程师使用分贝值来方便地比较两个信号的电压幅度水平。与方程 (B-1) 和 (B-2) 类似,信号处理人员使用方程

As we stated at the beginning of this appendix, signal processing engineers use decibel values to conveniently compare the voltage amplitude levels of two signals. Similar to equations (B-1) and (B-2), signal processing folk use the equation

Image

来计算表示两个信号之间的相对幅度差的分贝 (dB) 值。值 A1 是一个信号的电压幅度,值 A2 是我们与信号 A1 进行比较的另一个信号的电压幅度。在我们查看在信号处理中使用分贝的示例之前,我们先介绍表 B.3,其中显示了两个信号幅度与等效分贝值的比率之间的关系。花点时间回顾一下表 B.3。请注意,当 A1 小于 A2 时,比率 A1/A2 小于 1,并且 dB 值为负数。

to compute a decibel (dB) value that represents the relative amplitude difference between two signals. Value A1 is the voltage amplitude of one signal and value A2 is the voltage amplitude of the other signal that we’re comparing to signal A1. Before we look at an example of using decibels in signal processing, we present Table B.3 showing the relationship between the ratio of two signal amplitudes and equivalent decibel values. Spend a few moments reviewing Table B.3. Notice that when A1 is less than A2, ratio A1/A2 is less than 1, and the dB value is a negative number.

Image

表 B.3相对分贝信号电平

Table B.3 Relative Decibel Signal Levels

例如,我们是如何解释表 B.3 的:如果信号 A1 的电压幅度是信号 A2 电压幅度的十分之一,我们说“A1 的幅度相对于信号 A2 负 20 dB”。信号处理工程师经常使用 dB 语言。

For example, here’s how we interpret Table B.3: if the voltage amplitude of signal A1 is one-tenth of the voltage amplitude of signal A2, we say “the amplitude of A1 is minus 20 dB relative to signal A2.” Signal processing engineers often speak in the language of dB.

与本附录中的前几个表格一样,讨论、解释和记录表 B.3 的中心列 dB 值比左列中笨拙、范围广泛的幅度比更容易。

As with the previous tables in this appendix, it’s easier to discuss, interpret, and document Table B.3’s center column dB values than the clumsy, wide-ranging amplitude ratios in the left column.

好,现在让我们看一个在信号处理中使用分贝的简单示例,它说明了表 B.3 中的 dB 值。图 B-1(a) 显示了复合模拟信号。我们将该信号命名为 Sin。信号 Sin 是正峰值幅度为 1 的 2 kHz 正弦波和正峰值幅度为 0.8 的 3 kHz 正弦波之和。为了便于说明,我们在图 B-1(b) 中显示了单独的 2 kHz 和 3 kHz 正弦波。同样,图 B-1(a) Sin 信号是图 B-1(b) 中实线波和虚线波的总和。信号 Sin 的频谱如图 B-1(c) 所示。

OK, let’s now look at a simple example of using decibels in signal processing that illustrates the dB values in Table B.3. Figure B-1(a) shows a composite analog signal. We will call that signal by the name Sin. Signal Sin is the sum of a 2 kHz sinusoidal wave whose positive peak amplitude is 1, and a 3 kHz sinusoidal wave whose positive peak amplitude is 0.8. For illustrative purposes, we show the individual 2 kHz and 3 kHz sinusoidal waves in Figure B-1(b). Again, the Figure B-1(a) Sin signal is the sum of the solid- and dashed-line waves in Figure B-1(b). The spectrum of signal Sin is given in Figure B-1(c).

Image

图 B-1模拟信号:(a) 复合时间信号 Sin;(b) 单独的 2 kHz 和 3 kHz 时间信号;(c) 单独的 2 kHz 和 3 kHz 频谱分量。

Figure B-1 Analog signal:(a) composite time signal Sin; (b) individual 2 kHz and 3 kHz time signals; (c) individual 2 kHz and 3 kHz spectral components.

假设我们决定从复合 S输入信号中删除(滤除)3 kHz 分量。我们可以通过将信号 S通过图 B-2(a) 所示的低通滤波器来做到这一点。截止频率为 2,500 Hz 的低通滤波器的工作原理如下:任何频率小于 2,500 Hz 的滤波器输入信号频谱能量都将通过滤波器并显示在滤波器的输出端,而不会损失振幅。此外,任何频率大于 2,500 Hz 的滤波器输入信号频谱能量都将通过滤波器并显示在滤波器的输出端,但幅度会有很大的损失。该行为如图 B-2(b) 所示。

Let’s assume we decide to remove (filter out) the 3 kHz component from the composite Sin signal. We can do that by passing signal Sin through the lowpass filter shown in Figure B-2(a). The lowpass filter, whose cutoff frequency is 2,500 Hz, operates as follows: any filter input-signal spectral energy with a frequency less than 2,500 Hz will pass through the filter and show up at the filter’s output with no loss in amplitude. In addition, any filter input-signal spectral energy with a frequency greater than 2,500 Hz will pass through the filter and show up at the filter’s output but with a significant loss in amplitude. That behavior is shown in Figure B-2(b).

Image

图 B-2低通滤波: (a) 滤波器输入和输出信号,低通滤波器截止频率。

Figure B-2 Lowpass filtering: (a) filter input and output signals, lowpass filter cutoff frequency.

图 B-1(a) S输入信号通过低通滤波器会产生图 B-2(a) 所示的 S输出输出信号,它看起来像图 B-1(b) 中的 2 kHz 实线曲线。低通滤波器似乎已经消除了 3 kHz 分量。但是我们的过滤器到底效果如何呢?假设我们将 Sout 信号应用于频谱分析仪的输入端,并获得图 B-3(b) 中给出的显示。在那里,我们看到 Sout 仍然包含非常少量的 3 kHz 正弦波。使用分贝,我们可以精确指定低通滤波器对不需要的 3 kHz 正弦波的衰减程度。方法如下。

Passing the Figure B-1(a) Sin signal through the lowpass filter produces an Sout output signal shown in Figure B-2(a), which looks like the 2 kHz solid-line curve in Figure B-1(b). It appears that the lowpass filter has eliminated the 3 kHz component. But how well did our filter really work? Let’s say we apply the Sout signal to the input of a spectrum analyzer and obtain the display given in Figure B-3(b). There, we see that Sout still contains a very small amount of the 3 kHz sine wave. Using decibels, we can specify exactly to what degree our lowpass filter attenuated the undesired 3 kHz sine wave. Here’s how.

图 B-1(c) 可以看出,滤波器输入端信号 Sin 的 3 kHz 分量的幅度为 0.8。我们将该振幅值分配给方程 (B-3) 中的变量 A2。从图 B-3(b) 可以看出,滤波器输出端信号 S 的不需要的 3 kHz 分量的幅度为 0.008,因此我们将该幅度值分配给变量 A1。比率 A1/A2 现在变为 A1/A2 = 0.008/0.8 = 0.01 = 1/100。从表 B.3 中可以看出,1/100 的 A1/A2 比率相当于 –40 分贝 (dB)。所以你有它。我们现在可以用以下两种等效方式之一来描述滤波器的性能:

From Figure B-1(c), the amplitude of the 3 kHz component of signal Sin at the filter’s input is 0.8. We assign that amplitude value to the variable A2 in equation (B-3). From Figure B-3(b), the amplitude of the undesired 3 kHz component of signal Sout at the filter’s output is 0.008, so we assign that amplitude value to the variable A1. The ratio A1/A2 now becomes A1/A2 = 0.008/0.8 = 0.01 = 1/100. From Table B.3, an A1/A2 ratio of 1/100 is equivalent to –40 decibels (dB). So there you have it. We can now describe the filter’s performance in either of these two equivalent ways:

• 低通滤波器的阻带增益为 –40 分贝 (–40 dB)。

• The lowpass filter’s stopband gain is –40 decibels (–40 dB).

• 低通滤波器将信号 Sin 不需要的 3 kHz 分量衰减了 40 dB。

• The lowpass filter attenuated signal Sin’s undesired 3 kHz component by 40 dB.

Image

图 B-3低通滤波:(a) 单独的 2 kHz 和 3 kHz 输出频谱分量;(b) 输出时间信号 Sout

Figure B-3 Lowpass filtering:(a) individual 2 kHz and 3 kHz output spectral components; (b) output time signal Sout.


顺便一提

By the Way

如果您需要使用方程 (B-3) 计算两个信号幅度之间的相对 dB 差异,那么您不一定需要一个科学的手动计算器。您可以使用 Microsoft Excel 电子表格软件计算 dB 值。例如,要计算振幅 0.008 除以振幅 0.8 的分贝水平,只需在 Excel 电子表格的单元格中输入以下内容:

On the off chance that you ever need to compute the relative dB difference between the amplitudes of two signals using equation (B-3), you don’t necessarily need a scientific hand calculator. You can compute dB values using Microsoft Excel spreadsheet software. For example, to compute the decibel level of an amplitude of 0.008 divided by an amplitude of 0.8, in a cell of an Excel spreadsheet merely enter the following:

=20*LOG10(0.008/0.8)

=20*LOG10(0.008/0.8)

然后点击键盘的 输入 键。数字 –40 将出现在该单元格中,表示分贝值为 –40 dB。

Then hit your keyboard’s Enter key. The number –40 will appear in that cell, meaning a decibel value of –40 dB.


用于描述滤波器的分贝

Decibels Used to Describe Filters

分贝值通常用于描述模拟和数字滤波器的性能。使用公式 (B-3),信号处理工程师绘制了滤波器频域行为的曲线,其中纵轴以分贝为单位测量。带通滤波器的一个例子如图 B-4 所示。

Decibel values are very often used to describe the performance of both analog and digital filters. Using equation (B-3), signal processing engineers plot a curve of a filter’s frequency-domain behavior where the vertical axis is measured in decibels. An example of this, for a bandpass filter, is shown in Figure B-4.

回想一下图 B-2 中的低通滤波器,它只允许频率大于 2,500 Hz 的信号通过滤波器。图 B-4 是一个带通滤波器,它允许频率在某个频带内的信号通过滤波器。

Recall the lowpass filter in Figure B-2 that only allowed signals whose frequencies were greater than 2,500 Hz to pass through the filter. Figure B-4 is a bandpass filter that allows signals whose frequencies are within a frequency band to pass through the filter.

Image

图 B-4使用分贝描述带通滤波器的频率响应。

Figure B-4 Describing a bandpass filter’s frequency response using decibels.

我们将图 B-4 解释如下:假设我们将振幅为 A2 的 1,000 Hz 正弦波应用于带通滤波器的输入端。根据图 B-4,1,000 Hz 滤波器输出正弦波的 A1 幅度相对于 A2 输入幅度为零分贝 (dB)。从表 B.3 中,我们可以看到 0 dB 表示比率 A1/A2 等于 1。因此,1,000 Hz 输出正弦波的振幅等于 1,000 Hz 输入正弦波的振幅。输入 1,000 Hz 正弦波到达滤波器输出端,幅度没有降低(无衰减)。

We interpret Figure B-4 as follows: Let’s say we apply a 1,000 Hz sine wave, whose amplitude is A2, to the input of the bandpass filter. According to Figure B-4, the A1 amplitude of the 1,000 Hz filter output sine wave is zero decibels (dB) relative to the A2 input amplitude. From Table B.3, we see that zero dB means that the ratio A1/A2 is equal to 1. So the 1,000 Hz output sine wave’s amplitude is equal to the 1,000 Hz input sine wave’s amplitude. The input 1,000 Hz sine wave arrived at the filter output with no reduction (no attenuation) in amplitude.

另一方面,假设我们现在将一个 2,500 Hz 的正弦波(幅度为 A2)应用于带通滤波器的输入端。根据图 B-4,2,500 Hz 滤波器输出正弦波的 A1 幅度相对于 A20 输入幅度为 –20 分贝 (–20 dB)。从表 B.3 中,我们可以看到 –20 dB 表示比率 A1/A2 等于 1/10。因此,2,500 Hz 输出正弦波的振幅等于 2,500 Hz 输入正弦波的振幅除以 10(衰减 10 倍)。

On the other hand, assume we now apply a 2,500 Hz sine wave, whose amplitude is A2, to the input of the bandpass filter. According to Figure B-4, the A1 amplitude of the 2,500 Hz filter output sine wave is –20 decibels (–20 dB) relative to the A2 input amplitude. From Table B.3 we see that –20 dB means that the ratio A1/A2 is equal to 1/10. So the 2,500 Hz output sine wave’s amplitude is equal to the 2,500 Hz input sine wave’s amplitude divided by 10 (attenuated by a factor of 10).

C. AM 和 FM 无线电信号

C. AM and FM Radio Signals

为了增强您对模拟信号的理解,值得花一些精力来了解两种类型的模拟信号,即 AM 和 FM 无线电信号。

To enhance your understanding of analog signals, it’s worth some effort to understand two types of analog signal that are “close to home,” AM and FM radio signals.

AM 无线电信号

AM Radio Signals

阅读本附录的每个人都曾听过 AM(调幅)收音机,这是使用无线电波传输信息的最古老的形式。AM 是一种将低频音频信号嵌入高频无线电信号的方法。无线电信号使用天线传输,AM 无线电接收器能够从发射的无线电信号中提取音频信号。然后,以波动电压的形式发出的音频信号被放大并施加到扬声器上。让我们看一下这些音频和射频 (RF) 信号的示例。

At one time or another, everyone who reads this appendix has listened to an AM (amplitude modulation) radio, the oldest form of transmitting information using radio waves. AM is a way of embedding a low-frequency audio signal in a high-frequency radio signal. The radio signal is transmitted using an antenna, and AM radio receivers are able to extract the audio signal from the transmitted radio signal. The audio signal, in the form of a fluctuating voltage, is then amplified and applied to a loudspeaker. Let’s look at an example of those audio and radio frequency (RF) signals.

图 C-1(a) 显示了由钢琴键盘上中音 C 上方的 A 键产生的 440 Hz 麦克风输出音频信号。图 C-1(b) 显示了高频 1.2MHz (1.2 MHz) RF 正弦波电压。如果我们将射频正弦波信号乘以低频音频信号,则结果是图 C-1(c) 所示的调制射频信号。请注意,调制后的 RF 信号的频率保持在 1.2 Mhz,但其峰谷幅度会随着时间的推移而波动。如图 C-1(d) 中的虚线所示,这些幅度波动称为调制射频信号的包络

Figure C-1(a) shows a 440 Hz microphone output audio signal generated by the A key above middle C on a piano keyboard. Figure C-1(b) shows a high-frequency 1.2MHz (1.2 megahertz) RF sine wave voltage. If we multiply the RF sine wave signal by the low-frequency audio signal, the result is the modulated RF signal shown in Figure C-1(c). Notice that the modulated RF signal’s frequency remains at 1.2 Mhz but it’s peak-to-valley amplitude fluctuates as time passes. As shown by the dashed-line curve in Figure C-1(d), those amplitude fluctuations are called the envelope of the modulated RF signal.

Image

图 C-1AM 无线电信号:(a) 440 Hz 音频音调;(b) 未调制的 1.2 Mhz RF(射频)正弦波信号;(c) 调幅射频信号;(d) 射频信号的包络(虚线)。

Figure C-1 AM radio signals: (a) 440 Hz audio tone; (b) unmodulated 1.2 Mhz RF (radio frequency) sine wave signal; (c) amplitude-modulated RF signal; (d) RF signal’s envelope (dashed curve).

这里的关键结果是,调制射频信号的包络与图 C-1(a) 中的 440 Hz 调制音频信号相同。因此,当图 C-1(c) 调幅射频信号使用天线作为电磁波传输时,AM 无线电接收器可以调谐到 1.2 Mhz,并从调制无线电信号中提取射频包络音频信号。在无线电接收器中,提取的 440 Hz 音频信号被放大,施加到扬声器上,然后我们听到钢琴的 440 Hz A 键音符。

The crucial result here is that the modulated RF signal’s envelope is identical to the 440 Hz modulating audio signal in Figure C-1(a). So when the Figure C-1(c) amplitude-modulated RF signal is transmitted as an electromagnetic wave using an antenna, an AM radio receiver can be tuned to 1.2 Mhz and extract the RF envelope audio signal from the modulated radio signal. In the radio receiver, the extracted 440 Hz audio signal is amplified, applied to a loudspeaker, and we then hear the 440 Hz A-key musical note of a piano.

同样,如果低频调制音频信号是来自麦克风的语音信号,我们将从 AM 接收器的扬声器中听到人类语音。至于广播 AM 信号的频谱,该主题在第 5 章的前面部分进行了介绍。

In a similar manner, if the low-frequency modulating audio signal were a voice signal from a microphone, we’d hear human speech from our AM receiver’s loudspeaker. As for the spectrum of a broadcast AM signal, that topic is covered in the early part of Chapter 5.

在 20 世纪下半叶,商业模拟电视的所有视频(图像)信号都使用 AM 技术进行广播。(你们中的一些人可能还记得安装在每个家庭和公寓顶部的精美电视天线。但是,与这些 AM 视频信号相结合的是电视音频信号,这些信号使用一种称为频率调制的技术进行广播。这是我们的下一个主题。

During the second half of the twentieth century, all video (image) signals of commercial analog television were broadcast using AM technology. (Some of you might remember the elaborate television antennas mounted atop every home and apartment.) However, combined with those AM video signals were the television audio signals, which were broadcast using a technique called frequency modulation. That is our next subject.

FM 无线电信号

FM Radio Signals

要了解 FM(调频)收音机中使用的模拟信号,让我们再次考虑来自钢琴上 A 键的 440 Hz 音频信号和高频 1.2MHz 射频正弦波电压。这些信号如图 C-2(a)图 C-2(b) 所示。

To understand the analog signals used in FM (frequency modulation) radio, let’s again think about a 440 Hz audio signal from the A key on a piano and a high-frequency 1.2MHz RF sine wave voltage. Those signals are shown in Figure C-2(a) and in Figure C-2(b).

Image

图 C-2FM 无线电信号:(a) 440 Hz 音频音调;(b) 未调制的高频射频正弦波信号;(c) 调频射频信号。

Figure C-2 FM radio signals: (a) 440 Hz audio tone; (b) unmodulated high-frequency RF sine wave signal; (c) frequency-modulated RF signal.

在 FM 收音机中,RF 正弦波信号的频率由 440 Hz 音频信号控制(调制)。如图 C-2(c) 所示,当 440 Hz 调制音频信号具有正振幅时,调制射频信号的频率会增加。当音频信号的振幅为负时,RF 信号的频率会降低。结果是高频 FM 无线电信号,其瞬时频率取决于调制音频信号的振幅。

In FM radio, the frequency of the RF sine wave signal is controlled (modulated) by the 440 Hz audio signal. As shown in Figure C-2(c), the modulated RF signal’s frequency is increased when the 440 Hz modulating audio signal has a positive amplitude. And the RF signal’s frequency is decreased when the audio signal has a negative amplitude. The result is a high-frequency FM radio signal whose instantaneous frequency depends on the amplitude of the modulating audio signal.

然后,图C-2(c)调频射频信号使用天线作为电磁波传输。当 FM 无线电接收器调谐到 1.2 Mhz 时,接收器会产生一个信号,其幅度取决于高频 FM RF 信号的瞬时频率。生成的信号与 440 Hz 音频调制信号相同。生成的信号被放大,施加到扬声器上,我们听到了钢琴的 440 Hz A 键音符。如果低频调制音频信号是来自麦克风的语音信号,我们将从 FM 接收器的扬声器中听到人类语音。

The Figure C-2(c) frequency-modulated RF signal is then transmitted as an electromagnetic wave using an antenna. When an FM radio receiver is tuned to 1.2 Mhz, the receiver generates a signal whose amplitude depends on the instantaneous frequency of the high-frequency FM RF signal. That generated signal is identical to the 440 Hz audio modulating signal. The generated signal is amplified, applied to a loudspeaker, and we hear the 440 Hz A-key musical note of a piano. If the low-frequency modulating audio signal had been a voice signal from a microphone, we’d hear human speech from our FM receiver’s loudspeaker.

比较 AM 和 FM 收音机

Comparing AM and FM Radio

表 C.1 提供了美国使用的商用 AM 和 FM 收音机的简要比较。

Table C.1 provides a brief comparison of commercial AM and FM radio as it is used in the United States.

Image

表 C.1商用 AM 和 FM 收音机比较

Table C.1 Commercial AM and FM Radio Comparison


顺便一提

By the Way

一般来说,历史书宣称意大利实验者古列尔莫·马可尼 (Guglielmo Marconi) 是无线电的发明者。事实是,第一个实现无线电发射和接收的人是 1895 年神秘的美国工程师尼古拉·特斯拉 (Nikola Tesla)。1901 年底,在富有的捐助者的支持下,马可尼以横跨大西洋传输摩尔斯电码信号而闻名。没有宣传的是马可尼使用特斯拉发明的振荡器线圈进行跨大西洋演示的事实。几十年来,特斯拉和马可尼之间的专利之争一直很激烈。1943 年,特斯拉去世几个月后,随着木槌落下,美国最高法院维持了第 645,576 号专利——特斯拉的原始无线电专利。可悲的是,历史学家忽视了这一法院裁决。

In general, history books proclaim Italian experimenter Guglielmo Marconi as the inventor of radio. The fact is, the first person to implement radio transmission and reception was the enigmatic American engineer Nikola Tesla in 1895. In late 1901, with the backing of wealthy benefactors, Marconi became famous for transmitting Morse code signals across the Atlantic Ocean. What wasn’t advertised was the fact that Marconi used Tesla-invented oscillator coils for his transatlantic demonstration. Battles over patents raged between Tesla and Marconi for decades. With the drop of the gavel in 1943, a few months after Tesla’s death, the U.S. Supreme Court upheld patent number 645,576—Tesla’s original radio patent. Sadly, historians have ignored that court decision.


D. 二进制数格式

D. Binary Number Formats

在数字信号处理中,有许多方法可以在计算硬件中表示数值数据。这些表示形式称为二进制数字格式,每种格式都有自己的优点和缺点。更简单的数字格式使我们能够使用简单的硬件设计,但代价是数字表示的范围有限,并且容易受到算术误差的影响。更复杂的数字格式在硬件中有些难以实现,但它们允许我们处理非常大和非常小的数字,同时提供对与二进制算术相关的许多数值精度问题的能力。为任何给定应用选择的数字格式可能意味着处理成功与失败之间的区别 - 这就是我们的数字信号处理橡胶与道路相遇的地方。

In digital signal processing, there are many ways to represent numerical data in computing hardware. These representations, called binary number formats, each have their own advantages and shortcomings. The simpler number formats enable us to use uncomplicated hardware designs at the expense of a restricted range of number representation and susceptibility to arithmetic errors. The more elaborate number formats are somewhat difficult to implement in hardware, but they allow us to manipulate very large and very small numbers while providing immunity to many numerical precision problems associated with binary arithmetic. The number format chosen for any given application can mean the difference between processing success and failure—it’s where our digital signal processing rubber meets the road.

在本附录中,我们将介绍最常见的二进制数格式类型,并说明使用它们的原因和时间。

In this appendix, we’ll describe the most common types of binary number formats, and show why and when they’re used.

无符号二进制数格式

Unsigned Binary Number Format

第 9 章中,我们介绍了二进制数,并提供了下表来说明如何使用二进制数字序列(0 和 1)来表示十进制数。

In Chapter 9, we introduced binary numbers and provided the following table to show how sequences of binary digits (0 and 1) could be used to represent decimal numbers.

二进制数中的位数称为其字长,因此 1101 的字长为 4,最左边的位称为最高有效位 (msb),而最右边的位称为最低有效位 (lsb)。

The number of bits in a binary number is known as its word length—hence 1101 has a word length of four, with the leftmost bit known as the most significant bit (msb), while the rightmost bit is called the least significant bit (lsb).

表 D.1 中的二进制数称为无符号二进制数,因为在当前形式中,它们只能表示正十进制数。要使二进制数在实践中完全有用,它们必须能够表示负十进制值。有许多不同的方法可以以二进制形式表示正数和负十进制数,这里我们介绍最流行的方法。

The binary numbers in Table D.1 are called unsigned binary numbers because in their current form, they can only represent positive decimal numbers. For binary numbers to be at all useful in practice, they must be able to represent negative decimal values. There are a number of different ways to represent both positive and negative decimal numbers in binary form and here we present the most popular ways to do so.

Image

表 D.1前 16 个二进制数

Table D.1 First 16 Binary Numbers

符号幅度二进制数格式

Sign-Magnitude Binary Number Format

我们可以使用二进制数来表示负十进制数,方法是在二进制字中指定一位来表示数字的符号。让我们考虑一种流行的二进制数格式,称为 sign-magnitude。在这里,我们假设二进制字的最左边的位是符号位,其余位表示始终为正的数字的大小。例如,我们可以说 4 位二进制数 00112 等于 +310,二进制数 10112 等于 –310,如图 D-1 所示。

We can use binary numbers to represent negative decimal numbers by dedicating one of the bits in a binary word to indicate the sign of a number. Let’s consider a popular binary number format known as sign-magnitude. Here, we assume that a binary word’s leftmost bit is a sign bit and the remaining bits represent the magnitude of a number that is always positive. For example, we can say that the 4-bit binary number 00112 is equal to +310 and the binary number 10112 is equal to –310 as shown in Figure D-1.

Image

图 D-1符号幅度数格式系统,使用最左边的位来表示正十进制数和负十进制数。

Figure D-1 Sign-magnitude number format system using the leftmost bit to indicate positive and negative decimal numbers.

当然,使用其中一个位作为符号位会减小我们可以表示的十进制数的大小。例如,一个 4 位无符号二进制字可以表示 16 个不同的十进制整数值,即 0–1510。在符号幅度二进制格式中,4 位字只能表示 –710 到 +710 范围内的十进制数。

Of course, using one of the bits as a sign bit reduces the magnitude of the decimal numbers we can represent. A 4-bit unsigned binary word, for example, can represent 16 different decimal integer values, 0–1510. In the sign-magnitude binary format, a 4-bit word can only represent decimal numbers in the range of –710 to +710.

二进制补码二进制数格式

Two’s Complement Binary Number Format

另一种常见的二进制数方案称为 2 的补码格式,它也使用最左边的位作为符号位。从硬件设计的角度来看,两者的补码格式是最方便的编号方案,并且已经使用了几十年。它使计算机能够使用相同的计算硬件执行加法和减法。要获得正 2 的补码二进制数的负版本,我们只需将每个位补码(将 1 位更改为 0 位,将 0 位更改为 1 位),并在补码字中加 1。例如,00112 表示二进制补码格式的十进制 310,我们通过图 D-2 所示的步骤得到 –310

Another common binary number scheme is known as the two’s complement format that also uses the leftmost bit as a sign bit. The two’s complement format is the most convenient numbering scheme from a hardware-design standpoint and has been used for decades. It enables computers to perform both addition and subtraction using the same computational hardware. To obtain the negative version of a positive two’s complement binary number, we merely complement (change a 1 bit to a 0 bit, and change a 0 bit to a 1 bit) each bit, and add 1 to the complemented word. For example, with 00112 representing a decimal 310 in two’s complement format, we obtain –310 through the steps shown in Figure D-2.

Image

图 D-2获取正 2 的补码二进制数的负数版本。

Figure D-2 Obtaining the negative version of a positive two’s complement binary number.

在 2 的补码格式中,一个 4 位字可以表示 –810 到 +710 范围内的十进制数。表 D.2 显示了符号幅度和 2 的补码二进制格式的 4 位字示例。

In the two’s complement format, a 4-bit word can represent decimal numbers in the range of –810 to +710. Table D.2 shows 4-bit word examples of sign-magnitude and two’s complement binary formats.

Image

表 D.2二进制数格式示例

Table D.2 Examples of Binary Number Formats

在使用二进制补码数时,我们在添加两个字长不同的数字时必须小心。考虑如图 D-3 所示的 4 位数字与 8 位数字相加的情况。

While using two’s complement numbers, we have to be careful when adding two numbers that have different word lengths. Consider the case where a 4-bit number is added to an 8-bit number as presented in Figure D-3.

Image

图 D-3将两个具有不同字长的正 2 补码数相加。

Figure D-3 Adding two positive two’s complement numbers that have different word lengths.

到目前为止没有问题。当我们的 4 位数字为负数时,就会出现问题。与其在 +1510 上加上 +310,不如尝试在 +1510 上加上 –310,如图 D-4 所示。

No problem so far. The trouble occurs when our 4-bit number is negative. Instead of adding a +310 to the +1510, let’s try to add a –310 to the +1510 as shown in Figure D-4.

Image

图 D-4错误地添加了具有不同字长的正二进制补码数和负数 2。

Figure D-4 Incorrectly adding a positive and a negative two’s complement number that have different word lengths.

可以通过对 4 位数字执行所谓的 sign-extend 操作来避免上述算术错误。此过程通常在计算机硬件中自动执行,它将 4 位负数的符号位向左扩展,使其成为 8 位负数。如果我们对 –310 进行签名扩展,然后执行加法,我们将得到如图 D-5 所示的正确答案。

The arithmetic error above can be avoided by performing what’s called a sign-extend operation on the 4-bit number. This process, typically performed automatically in computer hardware, extends the sign bit of the 4-bit negative number to the left making it an 8-bit negative number. If we sign-extend the –310 and then perform the addition, we’ll get the correct answer as we see in Figure D-5.

Image

图 D-5正确添加具有不同单词长度的正二进制补码数和负数 2。

Figure D-5 Correctly adding a positive and a negative two’s complement number that have different word lengths.

偏移二进制数格式

Offset Binary Number Format

另一种有用的二进制数方案称为偏移二进制数格式。虽然这种格式不像两者的 complement binary number 格式那样常见,但它仍然出现在一些硬件中。表 D.2 显示了 4 位二进制字的偏移二进制格式示例。读者可能会感兴趣,我们只需对二进制单词的最高有效位进行补码(将 1 更改为 0,将 0 更改为 1)即可在两者的补码和偏移二进制格式之间来回转换。

Another useful binary number scheme is known as the offset binary number format. Although this format is not as common as the two’s complement binary number format, it still shows up in some hardware. Table D.2 shows offset binary format examples for 4-bit binary words. It may interest the reader that we can convert, back and forth, between the two’s complement and offset binary formats merely by complementing (change a 1 to a 0, and change a 0 to a 1) a binary word’s most significant bit.

许多可用数字格式的历史、算术和效用是一个非常广泛的研究领域。Donald E. Knuth 的 The Art of Computer Programming: Seminumerical Methods, vol. 2 中对该主题进行了全面且可读性很强的讨论。

The history, arithmetic, and utility of the many available number formats is a very broad field of study. A thorough and very readable discussion of the subject is given in Donald E. Knuth’s The Art of Computer Programming: Seminumerical Methods, vol. 2.

备用二进制数表示法

Alternate Binary Number Notation

随着 1960 年代商用计算机和 1970 年代家用计算机的使用迅速扩大,计算机程序员厌倦了在纸上处理长串 1 和 0,并开始使用更方便的方式来表示二进制数使用 1 或 0 以外的数字。表示二进制数的两种最流行的表示法称为八进制二进制数表示法十六进制二进制数表示法

As the use of business computers in the 1960s and home computers in the 1970s rapidly expanded, computer programmers grew tired of manipulating long strings of ones and zeros on paper and began to use more convenient ways to represent binary numbers using digits other than a 1 or a 0. The two most popular notational ways to represent binary number are called octal binary number notation and hexadecimal binary number notation.

八进制二进制数表示法

Octal Binary Number Notation

八进制二进制数表示法使用以 8 为基数的数字系统。从二进制转换为八进制就像从右侧开始将二进制数分成 3 位组一样简单。例如,二进制数10101001 2 可以转换为八进制格式,如图 D-6 所示。在该图中,我们使用下标 8 来表示八进制数。

The octal binary number notation uses a base-8 number system. Converting from binary to octal is as simple as separating the binary number into 3-bit groups starting from the right. For example, the binary number 101010012 can be converted to octal format as shown in Figure D-6. In that figure, we use a subscripted 8 to signify an octal number.

Image

图 D-6表示具有 3 个八进制数字的 8 位二进制字。

Figure D-6 Representing an 8-bit binary word with 3 octal digits.

使用八进制表示法的价值在于,与 8 位二进制数相比,它更容易编写、记住和表达 3 位八进制数。对于程序员来说,八进制数 2518 比二进制数 101010012 更容易使用。当然,八进制表示法中唯一有效的数字是 0-7。十进制数字 8 和 9 在八进制表示中没有意义。

The value of using octal notation is that it’s easier to write, remember, and verbalize a 3-digit octal number than an 8-digit binary number. The octal number 2518 is simply easier for programmers to work with than the binary number 101010012. Of course, the only valid digits in the octal notation are 0–7. The decimal digits 8 and 9 have no meaning in octal representation.

十六进制二进制数表示法

Hexadecimal Binary Number Notation

另一种流行的二进制格式是使用 16 作为基数的十六进制二进制数表示法。从二进制转换为十六进制是通过将二进制数从右侧开始分成 4 位组来完成的。二进制数10101001 2 转换为十六进制格式,如图 D-7 所示。

Another popular binary format is the hexadecimal binary number notation using 16 as its base. Converting from binary to hexadecimal is done by separating the binary number, this time, into 4-bit groups starting from the right. The binary number 101010012 is converted to hexadecimal format as shown in Figure D-7.

十六进制数字表示法的特殊之处在于它使用字母来表示大于 9 的十进制值。例如,图 D-7 中的 4 位数字 10102 =10 10 以十六进制表示法表示为 A16。在这里,我们使用下标 16 来表示十六进制数。

The peculiar aspect of hexadecimal number notation is that it uses letters to represent decimal values greater than 9. For example, the 4-bit number 10102 = 1010 in Figure D-7 is represented as A16 in hexadecimal notation. Here, we use a subscripted 16 to signify a hexadecimal number.

Image

图 D-7表示具有 2 个十六进制数字的 8 位二进制字。

Figure D-7 Representing an 8-bit binary word with 2 hexadecimal digits.

如果您以前没有见过十六进制表示法,请不要让上面的 A916 数字让您感到困惑。在此表示法中,字母 A、B、C、D、E 和 F 分别表示十进制数字 10、11、12、13、14 和 15。表 D.3 列出了备用八进制和十六进制二进制数表示法中允许的数字表示形式。

If you haven’t seen hexadecimal notation before, don’t let the A916 number above confuse you. In this notation, the letters A, B, C, D, E, and F represent the decimal digits 10, 11, 12, 13, 14, and 15, respectively. Table D.3 lists the permissible digit representations in the alternate octal and hexadecimal binary number notations.

Image

表 D.3备用二进制数表示法中使用的数字

Table D.3 The Digits Used in Alternate Binary Number Notations

与八进制表示法一样,使用十六进制表示法的价值在于,与 8 位二进制数相比,它更容易书写、记住和表达 2 位十六进制数。

Like octal notation, the value of using hexadecimal notation is that it’s simply easier to write, remember, and verbalize a 2-digit hexadecimal number than an 8-digit binary number.

词汇表

Glossary

交流

AC

请参阅交流电

See alternating current.

模数转换器

ADC

请参阅 模数转换器

See analog-to-digital converter.

算法

Algorithm

对数字信号执行并用于执行给定信号处理目标的明确定义的数学步骤序列。数字滤波和离散傅里叶变换 (DFT) 的过程是算法的示例。

A clearly defined sequence of mathematical steps performed on digital signals and used to perform a given signal processing objective. The processes of digital filtering and the discrete Fourier transform (DFT) are examples of algorithms.

别名

Alias

高频模拟正弦波的频率,当使用模数转换器采样时,在转换后的数字信号中显示为较低频率的正弦波。

The frequency of a high-frequency analog sine wave that, when sampled with an analog-to-digital converter, appears as a lower-frequency sine wave in the converted digital signal.

混 叠

Aliasing

对模拟信号进行采样时可能发生的不良影响。当高频模拟信号频谱分量在采样的数字信号中错误地显示为低频频谱分量时,就会发生混叠。如果模数转换的采样率大于输入模拟信号中最高频率频谱分量(奈奎斯特采样标准)的两倍,则可以避免混叠。

An undesirable effect that can occur when sampling an analog signal. Aliasing occurs when a high-frequency analog signal spectral component falsely appears as a low-frequency spectral component in the sampled digital signal. Aliasing is avoided if the sample rate of the analog-to-digital conversion is greater than twice the highest-frequency spectral component in the input analog signal (Nyquist sampling criterion).

交流电 (AC)

Alternating current (AC)

用于描述其振幅随时间波动的模拟信号电压的术语。

A term used to describe an analog signal voltage whose amplitude fluctuates over time.

AM

参见 amplitude modulation

See amplitude modulation.

放大器

Amplifier

一种电子电路或电子设备,用于增加模拟信号的振幅(或功率)。

An electronic circuit, or electronic device, used to increase the amplitude (or power) of an analog signal.

波幅

Amplitude

时域模拟电压波形在任何时刻的电压,指示其瞬时能量。有时,工程师使用振幅一词来描述时域正弦波的最大正值。

The voltage at any instant in time of a time-domain analog voltage waveform indicating its instantaneous energy. Sometimes engineers use the word amplitude to describe the maximum positive value of a time-domain sinusoidal wave.

调幅

Amplitude modulation

一种无线电通信方法,其中高频正弦波的振幅由低频音频信号的振幅调制(控制)。然后可以使用天线将高频调幅正弦波作为电磁波传输。AM 无线电接收器设计用于接收和提取调幅无线电波的音频信号。

A radio communication method where the amplitude of a high-frequency sine wave is modulated (controlled) by the amplitude of a low-frequency audio signal. The high-frequency amplitude modulated sine wave can then be transmitted as an electromagnetic wave using an antenna. AM radio receivers are designed to receive and extract the audio signal from the amplitude-modulated radio wave.

模拟滤波器

Analog filter

互连的电子硬件组件的集合,用于将模拟电压信号(输入)转换为另一个电压信号(输出),具有修改后的频域频谱。请参阅低通带通和高通滤波器

A collection of interconnected electronic hardware components that transforms an analog voltage signal (the input) into another voltage signal (the output) having a modified frequency domain spectrum. See lowpass, bandpass, and highpass filters.

模拟信号

Analog signal

与由离散数字组成的数字信号相比,模拟信号是携带信息的连续信号(通常是电压),它随时间变化,可以采用其最小值和最大值之间的任何值。

In contrast to a digital signal that is a sequence of discrete numbers, an analog signal is an information-carrying continuous signal (typically a voltage) that varies over time and can take on any value between its minimum and maximum values.

模数转换器 (ADC)

Analog-to-digital converter (ADC)

一种硬件设备,在其输入端接受模拟电压信号并产生周期性的数字流。这些数字表示在周期性间隔的时刻的模拟电压值。时刻的重复率由输入到 converter 的周期性 clock 的频率 (采样率) 决定。

A hardware device that accepts, at its input, an analog voltage signal and produces a periodic stream of numbers. The numbers represent the value of the analog voltage at periodically spaced instants in time. The repetition rate of the instants in time is determined by the frequency (sample rate) of the periodic clock input to the converter.

抗锯齿滤镜

Anti-aliasing filter

一种模拟低通滤波器,用于在模拟信号施加到模数转换器 (ADC) 之前限制模拟信号的带宽。还用于描述模拟低通滤波器,用于限制数模转换器 (DAC) 产生的模拟信号的带宽。

An analog lowpass filter used to limit the bandwidth of an analog signal before that analog signal is applied to an analog-to-digital converter (ADC). Also used to describe an analog lowpass filter used to limit the bandwidth of an analog signal produced by a digital-to-analog converter (DAC).

衰减

Attenuation

信号通过数字滤波器后产生的幅度损失,通常以 dB 为单位。滤波器衰减是指在给定频率下,滤波器输出端的信号幅度除以滤波器输入端的信号幅度的比率。

An amplitude loss, usually measured in dB, incurred by a signal after passing through a digital filter. Filter attenuation is the ratio, at a given frequency, of the signal amplitude at the output of the filter divided by the signal amplitude at the input of the filter.

音频

Audio

描述频率内容在 50 Hz 到 15 kHz 范围内的信号。施加到扬声器端子的音频电压信号将产生气压波,人类可以听到这种气压波。

Describes signals whose frequency content is in the range of 50 Hz to 15 kHz. An audio voltage signal, applied to the terminals of a loudspeaker, will generate air pressure waves that can be heard as sound by human beings.

平均器

Averager

请参见 moving averager

See moving averager.

带通滤波器

Bandpass filter

如图 G-1 所示,滤波器通过一个频带,从频率 f1 到频率 f2,并衰减该频带以上和以下的频率。

A filter, as shown in Figure G-1, that passes one frequency band, from frequency f1 to frequency f2, and attenuates frequencies above and below that band.

Image

图 G-1带通滤波器。

Figure G-1 Bandpass filter.

带阻滤波器

Bandstop filter

一种滤波器,可抑制(衰减)一个频带(从频率 f1 到频率 f2),并通过较低频带和较高频带。图 G-2 描述了理想带阻数字滤波器的频率响应。

A filter that rejects (attenuates) one frequency band, from frequency f1 to frequency f2, and passes both a lower- and a higher-frequency band. Figure G-2 depicts the frequency response of an ideal band reject digital filter.

Image

图 G-2带阻滤波器。

Figure G-2 Bandstop filter.

带宽

Bandwidth

信号包含大量频谱能量的频率范围或滤波器通带的频率宽度。请参阅 passband

The frequency range over which a signal contains significant spectral energy or the frequency width of the passband of a filter. See passband.

以 2 为基数的数字系统

Base-2 number system

请参阅二进制数系统

See binary number system.

以 10 为基数的数字系统

Base-10 number system

我们熟悉的计数系统有 10 个不同的数字,从 0 到 9。第 9 章讨论了数字信号处理中使用的 base-10 数字系统和其他数字系统。

Our familiar system of counting that has ten different digits, 0 through 9. Chapter 9 discusses the base-10 number system and other numbers systems used in digital signal processing.

二进制数系统

Binary number system

一种只有两位数(0 和 1)的计数系统。我们在传统十进制数系统中执行的所有算术运算,例如加法、减法、乘法和除法,都可以在二进制数系统中执行。使用二进制数系统是因为它是使用电子元件执行算术运算的最便宜和最可靠的方法。

A system of counting that has only two digits, 0 and 1. All of the arithmetic operations that we perform in our traditional decimal number system, such as addition, subtraction, multiplication, and division, can be performed in the binary number system. The binary number system is used because it is the most inexpensive and reliable way to perform arithmetic operations using electronic components.

Bit

位(Binary digIT 的缩写)是二进制数中的最小信息单位。位是 0 或 1 的单个二进制数字。

A bit (short for Binary digIT) is the smallest unit of information in a binary number. A bit is a single binary digit of either 0 or 1.

广播

Broadcast

使用天线辐射携带信息的模拟电磁信号的过程。

The process of radiating an information-carrying analog electromagnetic signal using an antenna.

字节

Byte

8 个二进制位的序列。

A sequence of 8 binary bits.

载波频率

Carrier frequency

广播无线电信号的带宽中心的频率。

The frequency of the center of the bandwidth of a broadcasted radio signal.

级联过滤器

Cascaded filters

过滤系统的实现,其中多个单独的过滤器串联连接。也就是说,一个滤波器的输出驱动下一个滤波器的输入,如图 G-3 所示。

The implementation of a filtering system where multiple individual filters are connected in a series. That is, the output of one filter drives the input of the following filter as illustrated in Figure G-3.

Image

图 G-3级联过滤器。

Figure G-3 Cascaded filters.

光盘

CD

请参阅光盘

See compact disc.

手机

Cell phone

蜂窝电话的简称:移动电话。

Short for cellular phone: a mobile telephone.

中心频率

Center frequency

位于带通滤波器中点的频率。图 G-4 显示了带通滤波器的 fo 中心频率。中心频率也用于指定位于信号频谱能量带中点的频率。

The frequency located at the midpoint of a bandpass filter. Figure G-4 shows the fo center frequency of a bandpass filter. Center frequency is also used to specify the frequency located at the midpoint of a band of signal spectral energy.

Image

图 G-4带通滤波器的中心频率。

Figure G-4 Center frequency of a bandpass filter.

芯片

Chip

单个集成电路的俚语。

Slang for a single integrated circuit.

电路

Circuit

实现电气目标的电子硬件设备的有组织的互连。

An organized interconnection of electronic hardware devices that accomplishes an electrical objective.

时钟信号

Clock signal

包含数字信号(如计算机或手机)的硬件设备内部的方波电压,用于同步各种电子电路的操作。

A square wave voltage inside a hardware device containing digital signals, such as a computer or a cell phone, used to synchronize the operation of various electronic circuits.

光盘 (CD)

Compact disc (CD)

一侧具有薄金属表面的塑料光盘,直径为 4.7 英寸,用于存储二进制数字数据文件和二进制数字音乐信号。CD 能够存储 0.7 GB 的二进制数据。

A plastic disc with a thin metal surface on one side, 4.7 inches in diameter, used to store both binary digital data files as well as binary digital music signals. CDs are able to store 0.7 gigabits of binary data.

连续信号

Continuous signals

请参阅 模拟信号

See analog signal.

余弦波

Cosine wave

一种正弦波形,其初始值(在零时间)由图 G-5 中的实线曲线表示。

A sinusoidal wave form whose initial value (at zero time) is shown by the solid-line curve in Figure G-5.

Image

图 G-5余弦波。

Figure G-5 Cosine wave.

截止频率

Cutoff frequency

低通滤波器的上限通带频率和高通滤波器的下通带频率。图 G-6 说明了低通滤波器的 fco 截止频率。

The upper passband frequency for lowpass filters, and the lower passband frequency for highpass filters. Figure G-6 illustrates the fco cutoff frequency of a lowpass filter.

Image

图 G-6低通滤波器的截止频率。

Figure G-6 Cutoff frequency of a lowpass filter.

每秒周期数

Cycles per second

频率的度量单位。

The unit of measure for frequency.

DAC 系列

DAC

请参阅数模转换器

See digital-to-analog converter.

分贝

dB

分贝

See decibel.

直流

DC

直流电的首字母缩写词。一个由来已久的技术术语,用于描述其振幅随时间推移而保持不变的信号(模拟电压或离散的数字序列)。

Acronym for direct current. A long-standing technical term used to describe a signal (either an analog voltage or a discrete sequence of numbers) whose amplitude remains constant as time passes.

直流电压

DC voltage

一种模拟电压,其幅度随时间推移而保持不变。

An analog voltage whose amplitude remains constant as time passes.

分贝

Decibel

衰减或增益的单位,用于表示两个信号之间的相对电压或功率差。附录 B 详细讨论了分贝。

A unit of attenuation, or gain, used to express the relative voltage or power difference between two signals. Appendix B discusses decibels in detail.

十进制数

Decimal numbers

我们每天使用的数字系统,包括 10 位数字、0、1、2、3、...9.

The number system we use every day that includes 10 digits, 0, 1, 2, 3, ... 9.

抽取

Decimation

降低数字信号的采样率。

Decreasing the sample rate of a digital signal.

DFT

DFT

请参阅离散傅里叶变换

See discrete Fourier transform.

数字滤波器

Digital filter

一种计算过程或算法,用于将离散时域数字序列 (输入) 转换为另一个具有修改后的频域频谱的离散数字序列 (输出)。请参阅低通带通和高通滤波器

A computational process, or algorithm, that transforms a discrete time-domain sequence of numbers (the input) into another discrete sequence of numbers (the output) having a modified frequency domain spectrum. See lowpass, bandpass, and highpass filters.

数字号码

Digital number

电子硬件使用或显示的数字。数字时钟表面显示的时间是一个数字数字,计算机键盘上的数字也是如此。

A number used, or displayed, by a piece of electronic hardware. The time shown on the face of a digital clock is a digital number, as are the numbers on a computer keyboard.

数字信号

Digital signal

一个承载信息的离散数字序列,其中每个数值只能是一组有限的可能值之一。这是本书中使用的数字信号的主要定义。也指电子设备内部在两个电压值之一之间波动的模拟电压。

An information-carrying discrete sequence of numbers where each numerical value can only be one of a limited set of possible values. This is the predominate definition of digital signal used in this book. Also refers to an analog voltage inside electronic equipment that fluctuates between one of two voltage values.

数字信号处理

Digital signal processing

信号数据样本的数值处理。

The numerical processing of signal data samples.

数字信号处理器

Digital signal processor

一种集成电路,专门用于对数值信号数据样本序列高效执行算术运算。

An integrated circuit specifically designed to efficiently perform arithmetic operations on sequences of numerical signal data samples.

数模转换器

Digital-to-analog converter

一种硬件设备,在其输入端接受数字采样值并产生输出模拟电压信号。

A hardware device that accepts, at its input, digital sample values and produces an output analog voltage signal.

数字视频光盘 (DVD)

Digital video disc (DVD)

直径为 4.7 英寸的金属光盘,用于存储数字数据文件和数字音乐信号。DVD 能够存储 4.7 GB 的二进制数据。

A metallic disc, 4.7 inches in diameter, used to store both digital data files as well as digital music signals. DVDs are able to store 4.7 gigabits of binary data.

直流

Direct current

一个由来已久的技术术语,用于描述其幅度随时间保持不变的信号(模拟电压或离散的数字序列)。

A long-standing technical term used to describe a signal (either an analog voltage or a discrete sequence of numbers) whose amplitude remains constant over time.

离散傅里叶变换

Discrete Fourier transform

对数字信号序列 (输入) 执行的数学过程,以生成一个数字序列序列,该序列表示这些输入时间序列的频谱 (谐波) 内容。

The mathematical process performed on digital signal sequences (the input) to produce a sequence of numbers representing the spectral (harmonic) content of those input time sequences.

缩减采样

Downsample

抽取

See decimation.

DSP

DSP

请参阅数字信号处理

See digital signal processing.

DSP

DSP

请参阅数字信号处理器

See digital signal processor.

快速傅里叶变换 (FFT)

Fast Fourier transform (FFT)

一种专用算法(一系列数学步骤),可非常有效地执行离散傅里叶变换 (DFT)。我们所说的“有效”是指数学运算的数量大大减少,这确实是一件非常好的事情。

A specialized algorithm (a sequence of mathematical steps) to very efficiently perform discrete Fourier transforms (DFTs). By “efficiently” we mean with a drastically reduced number of mathematical operations, which is a very good thing indeed.

滤波器

Filter

一种硬件设备(用于模拟信号)或算术过程(用于数字信号),用于修改时域信号的频谱内容。

A hardware device (for analog signals) or arithmetic process (for digital signals), used to modify the spectral content of a time-domain signal.

有限脉冲响应滤波器 (FIR)

Finite impulse response filter (FIR)

定义一类具有完全线性相位行为的数字滤波器。

Defines a class of digital filters that have exactly linear-phase behavior.

冷杉

FIR

请参阅有限脉冲响应滤波器

See finite impulse response filters.

调频

FM

请参阅 频率调制

See frequency modulation.

频率

Frequency

衡量在一秒钟的时间段内重复周期波的多少个完整周期。频率的典型测量单位是赫兹 (Hz)。为了方便数学分析(代数),频率有时以每秒弧度为单位进行测量。请参见每秒弧度数。

A measure of how many complete cycles of a periodic wave repeat in the time period of one second. The typical units of measure of frequency are hertz (Hz). For convenience in mathematical analysis (algebra), frequency is sometimes measured in radians per second. See radians per second.

频域

Frequency domain

一个形容词,用于指定信号的频谱内容。

An adjective meant to specify the spectral content of a signal.

调频

Frequency modulation

一种无线电通信方法,其中高频正弦波的频率由低频音频信号的振幅调制(控制)。然后可以使用天线将高频 FM 正弦波作为电磁波传输。FM 无线电接收器设计用于接收和提取来自调频无线电波的音频信号。

A radio communication method where the frequency of a high-frequency sine wave is modulated (controlled) by the amplitude of a low-frequency audio signal. The high-frequency FM sine wave can then be transmitted as an electromagnetic wave using an antenna. FM radio receivers are designed to receive and extract the audio signal from the frequency modulated radio wave.

频率响应

Frequency response

滤波器如何与输入信号交互的频域描述。图 G-7(a) 中的粗体实线是截止频率为 fco Hz 的数字低通滤波器的频率响应。图 G-7(b) 描述了数字高通滤波器的频率响应。

A frequency domain description of how a filter interacts with input signals. The bold solid curve in Figure G-7(a) is the frequency response of a digital lowpass filter having a cutoff frequency of fco Hz. Figure G-7(b) depicts the frequency response of a digital highpass filter.

Image

图 G-7滤波器频率响应:(a) 低通滤波器;(b) 高通滤波器。

Figure G-7 Filter frequency responses: (a) lowpass filter; (b) highpass filter.

获得

Gain

放大器电路完成的放大量。例如,增益为 4 表示放大器输出信号的幅度是输入信号幅度的四倍。

The amount of amplification accomplished by an amplifier circuit. For example, a gain of 4 means the amplifier output signal’s amplitude is four times as great as the input signal’s amplitude.

千兆

Gb

千兆位的首字母缩写词,1,073,741,824 位二进制数据。

An acronym for gigabits, 1,073,741,824 bits of binary data.

国标

GB

千兆字节的首字母缩写词,1,073,741,824 字节 = 8 × 1,073,741,824 = 8,589,934,592 位二进制数据。

An acronym for gigabytes, 1,073,741,824 bytes = 8 × 1,073,741,824 = 8,589,934,592 bits of binary data.

千兆赫

Ghz

频率为 1 GHz(每秒 1,000,000,000 个周期)的首字母缩写词。

An acronym for the frequency of 1 gigahertz (1,000,000,000 cycles per second).

Ground

电路中一个点或节点,电路中的所有电压都引用该点或节点。

A point, or node, in an electrical circuit to which all voltages in the circuit are referred.

半带滤波器

Half-band filter

一种 FIR 数字滤波器,其中过渡区域以采样率的四分之一 (fs/4) 为中心。由于频域对称性,半带滤波器经常用于抽取方案,因为它们的时域系数有一半为零。这减少了生成每个滤波器输出样本所需的必要乘法运算的数量。

A type of FIR digital filter where the transition region is centered at one-quarter of the sampling rate, or fs/4. Due to their frequency domain symmetry, half-band filters are often used in decimation schemes because half their time domain coefficients are zero. This reduces the number of necessary multiplication operations needed to produce each filter output sample.

谐波失真

Harmonic distortion

对时间信号形状的无意和不希望的修改,在该时间信号中产生不需要的频谱分量。

An inadvertent and undesirable modification of the shape of a time signal that produces unwanted spectral components in that time signal.

谐波

Harmonics

时间信号中不需要的频谱分量,会导致时间信号形状的意外失真。也用于描述周期性时间信号(例如方波或三角波)中包含的高频频谱分量。

The undesirable spectral components in a time signal that cause an inadvertent distortion of the shape of the time signal. Also used to describe the high-frequency spectral components contained in periodic time signals (such as square or triangular waves).

高清晰度电视

HDTV

请参阅高清电视

See high-definition television.

赫兹 (Hz)

Hertz (Hz)

频率的度量值,相当于每秒的周期数 (每秒振荡数)。

A measure of frequency equivalent to cycles per second (oscillations per second).

十六进制二进制数

Hexadecimal binary numbers

计算机程序员使用 1 或 0 以外的数字表示二进制数的一种便捷方法。见附录 D

A convenient way for computer programmers to represent binary numbers using digits other than a 1 or 0. See Appendix D.

高清电视

High-definition television

一种全数字系统,用于传输电视信号,其分辨率远高于旧的模拟电视信号。高清电视 (HDTV) 可以显示多种分辨率(高达 200 万像素,而旧电视的分辨率为 360,000 像素)。HDTV 使用 24 个二进制位来定义像素的颜色,从而提供更好的颜色再现。

An all-digital system for transmitting a TV signal with far greater resolution than the older analog TV signals. A high-definition television (HDTV) can display several resolutions (up to two million pixels versus an older television’s 360,000). HDTV uses 24 binary bits to define a pixel’s color, which provides improved color rendition.

高保真度

High fidelity

音频爱好者使用的术语,指的是高质量的音频声音。例如,我们所说的高质量是指昂贵的 FM 立体声系统的音频听起来与我们通过手机听到的音频相比如何。

A term used by audio enthusiasts that refers to high-quality audio sound. By high-quality we mean, for example, how the audio from an expensive FM stereo system sounds compares to the audio we hear over a cell phone.

高通滤波器

Highpass filter

如图 G-7(b) 所示,通过高频并衰减低频的滤波器。我们都在客厅里经历过一种高通滤波。请注意当我们在家庭立体声系统上调高音控制(或调低低音控制)时会发生什么。音频放大器通常平坦的频率响应转变为一种模拟高通滤波器,随着音乐的高频成分被强调,为我们提供了尖锐而细小的声音。

A filter that passes high frequencies and attenuates low frequencies as shown in Figure G-7(b). We’ve all experienced a kind of highpass filtering in our living rooms. Notice what happens when we turn up the treble control (or turn down the bass control) on our home stereo systems. The audio amplifier’s normally flat frequency response changes to a kind of analog highpass filter giving us that sharp and tinny sound as the high-frequency components of the music are accentuated.

IIR (二)

IIR

请参阅无限脉冲响应滤波器

See infinite impulse response filter.

脉冲响应

Impulse response

当输入是单个单位值样本(脉冲)前后为零值样本时,数字滤波器的时域输出序列。数字滤波器的频域响应可以通过对滤波器的时域脉冲响应执行离散傅里叶变换 (DFT) 来计算。

A digital filter’s time domain output sequence when the input is a single unity-valued sample (impulse) preceded and followed by zero-valued samples. A digital filter’s frequency domain response can be calculated by performing the discrete Fourier transform (DFT) of the filter’s time domain impulse response.

无限脉冲响应 (IIR) 滤波器

Infinite impulse response (IIR) filter

定义一类数字滤波器,这些滤波器不能保证稳定且始终具有非线性相位响应。无限脉冲响应 (IIR) 滤波器比数字有限脉冲响应 (FIR) 滤波器具有更陡峭的过渡区域滚降(性能卓越)。

Defines a class of digital filters that are not guaranteed to be stable and always have nonlinear phase responses. Infinite impulse response (IIR) filters have a much steeper transition region roll-off (superior performance) than digital finite impulse response (FIR) filters.

整数

Integers

正整数或负整数,例如 23、–57 或 99。

Positive or negative whole numbers such as 23, –57, or 99.

集成电路

Integrated circuit

封装在小型塑料或陶瓷块中的互连(集成)晶体管的小型集合。

A miniaturized collection of interconnected (integrated) transistors encapsulated in a small plastic or ceramic block.

插值

Interpolation

提高数字信号的采样率。

Increasing the sample rate of a digital signal.

JPEG 格式

JPEG

行业标准的电子图像文件压缩方法。JPEG 代表联合图像专家组。

Industry-standard electronic image file compression method. JPEG stands for Joint Photographic Experts Group.

千字节

Kb

千位的首字母缩写词,1,024 位二进制数据。

An acronym for kilobits, 1,024 bits of binary data.

知识库

KB

千字节的首字母缩写词,1,024 字节 = 8 × 1,024 = 8,192 位二进制数据。

An acronym for kilobytes, 1,024 bytes = 8 × 1,024 = 8,192 bits of binary data.

千 赫

kHz

频率为 1 kHz(每秒 1,000 个周期)的首字母缩写词。

An acronym for the frequency of 1 kilohertz (1,000 cycles per second).

Ksps

Ksps

kilosamples per second 的首字母缩写词,即模拟信号的采样速率,以每秒数千个样本为单位。

An acronym for kilosamples per second, the rate at which an analog signal can be sampled, measured in thousands of samples per second.

最低有效位

Least significant bit

二进制字中最右边的位(二进制位序列)。

The rightmost bit in a binary word (sequence of binary bits).

线性相位滤波器

Linear phase filter

一种滤波器,其相位角 (度) 随频率变化。合成的滤波器相位图与频率的关系是一条直线。因此,线性相位滤波器的 Group delay 是一个常数。为了保持其信息承载信号的完整性,线性相位是手机和其他无线系统中使用的滤波器的重要标准。

A filter that exhibits a constant change in phase angle (degrees) over frequency. The resultant filter phase plot versus frequency is a straight line. As such, a linear phase filter’s group delay is a constant. In order to preserve the integrity of their information-carrying signals, linear phase is an important criteria for filters used in cell phones and other wireless systems.

扬声器

Loudspeaker

一种将电压信号转换为气压波(声音)的硬件设备。扬声器的工作频率范围为 50 Hz 至 15 kHz。

A hardware device that converts an electrical voltage signal to air pressure waves (sound). Loudspeakers operate over the frequency range of 50 Hz to 15 kHz.

低通滤波器

Lowpass filter

如图 G-7(a) 所示,通过低频并衰减高频的滤波器。举个例子,当我们调高家庭立体声系统的低音控制(或调低高音控制)时,我们会体验到低通滤波,随着音乐的低频成分被增强,我们得到沉闷而沉闷的声音。

A filter that passes low frequencies and attenuates high frequencies as shown in Figure G-7(a). By way of an example, we experience lowpass filtering when we turn up the bass control (or turn down the treble control) on our home stereo systems, giving us that dull muffled sound as the low frequency components of the music are intensified.

Mb

兆位的首字母缩写词,1,048,576 位二进制数据。

An acronym for megabits, 1,048,576 bits of binary data.

MB

MB

兆字节的首字母缩写词,1,048,576 字节 = 8 × 1,048,576 = 8,388,608 位二进制数据。

An acronym for megabytes, 1,048,576 bytes = 8 × 1,048,576 = 8,388,608 bits of binary data.

兆赫

Mhz

频率为 1 兆赫兹(每秒 1,000,000 个周期)的首字母缩写词。

An acronym for the frequency of 1 megahertz (1,000,000 cycles per second).

微片

Microchip

单个集成电路的俚语。

Slang for a single integrated circuit.

麦克风

Microphone

一种将气压波(声音)转换为电压信号的硬件设备。麦克风的工作频率范围为 50 Hz 至 15 kHz。

A hardware device that converts air pressure waves (sound) to an electrical voltage signal. Microphones operate over the frequency range of 50 Hz to 15 kHz.

混合

Mixing

对于音频信号,混合是添加两个或多个信号以创建复合音频信号的过程。对于射频范围内的信号,混频是将一个信号乘以第二个信号的过程。这种射频混合用于产生 AM 广播无线电信号。

For audio signals, mixing is the process of adding two or more signals to create a composite audio signal. For signals in the radio frequency range, mixing is the process of multiplying one signal by a second signal. This radio frequency mixing is used to produce AM broadcast radio signals.

最高有效位

Most significant bit

二进制字中最左边的位 (二进制位序列)。

The leftmost bit in a binary word (sequence of binary bits).

移动平均线

Moving averager

一种算术简单的数字低通滤波过程,其中对固定数量的连续输入信号采样值进行平均,以产生一系列滤波器输出采样。有关移动平均器滤波过程的示例,请参见第 8 章

An arithmetically simple digital lowpass filtering process where a fixed number of successive input signal sample values are averaged to produce a sequence of filter output samples. See Chapter 8 for an example of a moving averager filtering process.

MPEG 的

MPEG

行业标准的电子视频文件压缩方法。MPEG 代表 Motion Picture Experts Group。

Industry-standard electronic video file compression method. MPEG stands for Motion Picture Experts Group.

毫秒数

Msps

Megasamples per second 的首字母缩写词。采样率 (用于对模拟信号进行采样) 以每秒数百万个样本为单位。

An acronym for megasamples per second. The sample rate, with which an analog signal can be sampled, measured in millions of samples per second.

Nibble

4 个二进制位的序列。(半字节

A sequence of 4 binary bits. (Half a byte.)

噪声

Noise

时域信号的不可控幅度波动,如图 G-8(b) 所示。噪声是随机的,没有有用的信息。噪声的存在使得测量重要的信号参数变得困难,通常被认为是不可取的。

The uncontrollable amplitude fluctuations of a time-domain signal as shown in Figure G-8(b). Noise is random and carries no useful information. The presence of noise makes it difficult to measure important signal parameters, and it is typically considered to be undesirable.

Image

图 G-8噪声:(a) 无噪声的模拟正弦波;(b) 受噪声污染的模拟正弦波。

Figure G-8 Noise: (a) a noise-free analog sine wave; (b) a noise-contaminated analog sine wave.

非递归滤波器

Nonrecursive filter

一种数字滤波器实现,其中不保留滤波器输出样本供以后计算未来的滤波器输出样本时使用。

A digital filter implementation where no filter output sample is retained for later use in computing a future filter output sample.

奈奎斯特采样标准

Nyquist sampling criterion

一种数字信号处理规则,规定:为避免不需要的频率混叠(数字信号失真),模数转换的采样率必须大于输入模拟信号中最高频率频谱内容的两倍。以美国工程师 Harry Nyquist 的名字命名。也称为 Shannon-Nyquist 采样定理。

A digital signal processing rule that states: To avoid undesirable frequency aliasing (digital signal distortion), the sample rate of analog-to-digital conversion must be greater than twice the highest frequency spectral content in the input analog signal. Named in honor of American engineer Harry Nyquist. Also called the Shannon-Nyquist sampling theorem.

八进制二进制数

Octal binary numbers

计算机程序员使用 1 或 0 以外的十进制数字表示二进制数的一种便捷方法。见附录 D

A convenient way for computer programmers to represent binary numbers using decimal digits other than a 1 or a 0. See Appendix D.

偏移二进制数

Offset binary numbers

一种使用二进制数表示正负十进制数值的方法。

A method of using binary numbers to represent both positive and negative decimal numerical values.

示波器

Oscilloscope

一种接受模拟电压作为输入并将这些电压波形显示为显示屏上的二维图的电子设备。图的纵轴是电压电平,显示屏的横轴是时间(秒)。

A piece of electronic equipment that accepts analog voltages as inputs and displays those voltage waveforms as two-dimensional plots on a display screen. The vertical axis of the plot is voltage level and the horizontal axis of the display is time (seconds).

通带

Passband

滤波器传递输入信号能量的频率范围,如图 G-7 所示。

The frequency range over which a filter passes input signal energy as depicted in Figure G-7.

通带纹波

Passband ripple

滤波器的通带幅度响应的波动,如图 G-9 所示。

Fluctuations in the passband amplitude response of a filter, as shown in Figure G-9.

Image

图 G-9Filter passband ripple(滤波器通带纹波)。

Figure G-9 Filter passband ripple.

印刷电路板

PC board

参见印刷电路板

See printed circuit board.

时期

Period

以秒为单位,周期性信号完成一次振荡所需的时间。

The period of time, measured in seconds, that it takes a periodic signal to complete one oscillation.

周期波

Periodic wave

一种模拟或数字信号,其时域波形随时间推移而重复。

An analog, or digital, signal whose time-domain waveform repeats as time passes.

相位响应

Phase response

在特定频率下,输入正弦波与该频率下的输出正弦波之间的相位差。相位响应(有时称为相位延迟)通常使用显示滤波器相移与频率的曲线来描述。

The difference in phase, at a particular frequency, between an input sine wave and the output sine wave at that frequency. The phase response, sometimes called phase delay, is usually depicted using a curve showing the filter’s phase shift versus frequency.

像素

Pixel

图片元素的缩写。图像的单个点(或点),例如计算机屏幕上的图像、数码相机照片或电视屏幕上的图像。一台 5 MP 的数码相机拍摄包含 5,000,000 个单独像素(彩色点)的照片。这些像素聚集在一起形成图像。请参阅高清电视

Short for picture element. A single point (or dot) of an image such as the image on a computer screen, digital camera photo, or television screen. A 5 megapixel digital camera takes pictures comprising 5,000,000 individual pixels (colored dots). Those pixels come together to form an image. See high-definition television.

印刷电路板

Printed circuit board

一块矩形塑料或玻璃纤维板,板上印刷或蚀刻有导电铜线。电子元件安装在电路板上,导电线(走线)连接元件以形成工作电路。家用计算机的主板是印刷电路板。印刷电路板避免了像几十年前那样在电子元件之间手工焊接电线的需要。

A rectangular plastic or fiberglass board with conductive copper lines printed or etched on the board. Electronic components are mounted on the board and the conductive lines (traces) connect the components to form a working circuit. The motherboard in your home computer is a printed circuit board. Printed circuit boards avoid the need to hand-solder electric wires between electronic components as was done decades ago.

量化

Quantization

将数字的可能值限制为具有指定精度的一组离散值。例如,将数字 17.3、–26.88 和 52.13 量化为整数意味着将这些数字转换为 17、–26 和 52。与模数转换器一样,量化是将模拟输入信号值的连续范围划分为不重叠的电压子范围的过程。当输入模拟信号值位于给定的电压子范围内时,转换器输出提供相应的唯一离散二进制数值。

To limit the possible values of a number to a discrete set of values of a specified precision. For example, quantizing the numbers 17.3, –26.88, and 52.13 to integers means to convert those numbers to 17, –26, and 52. As related to analog-to-digital converters, quantization is the process whereby the continuous range of an analog input signal’s values is divided into nonoverlapping voltage subranges. When an input analog signal value resides within a given voltage subrange, the converter output provides the corresponding unique, discrete binary numerical value.

每秒弧度数

Radians per second

周期波在一秒的时间段内重复频率的角度度量。主要用于数学分析(代数)。一个 360 度周期等于 2π 弧度。一弧度大约等于 57.2 度。

An angular measure of how often a periodic wave repeats in the time period of one second. Primarily used in mathematical analysis (algebra). One 360-degree cycle is equal to 2π radians. One radians is roughly equal to 57.2 degrees.

射频

Radio frequency

辐射正弦电磁波的频带范围:

Ranges of frequency bands of radiated sinusoidal electromagnetic waves:

• 超低频 (ULF):DC–30 Hz

• ultra-low frequency (ULF): DC–30 Hz

• 极低频 (ELF):30–300 Hz

• extremely low frequency (ELF): 30–300 Hz

• 语音级信道 (VGC):300–3400 Hz

• voice-grade channel (VGC): 300–3400 Hz

• 极低频 (VLF):3–30 kHz

• very low frequency (VLF): 3–30 kHz

• 甚高频 (VHF):30–300 MHz

• very high frequency (VHF): 30–300 MHz

• 超高频 (UHF):300–3000 MHz

• ultra-high frequency (UHF): 300–3000 MHz

递归过滤器

Recursive filter

一种数字滤波器实现,其中保留当前滤波器输出样本,以便以后在计算未来的滤波器输出样本时使用。

A digital filter implementation where current filter output samples are retained for later use in computing future filter output samples.

射频

RF

请参阅无线电频率

See radio frequency.

样本

Sample

数字信号的数字序列中的单个数字,单个元素。采样一词是指使用模数转换器将模拟信号转换为数字信号(离散的数字序列)的过程。

A single number, a single element, of a digital signal’s sequence of numbers. The word sampling refers to the process of converting an analog signal to a digital signal (a discrete sequence of numbers) using an analog-to-digital converter.

采样频率

Sample frequency

请参阅采样率

See sample rate.

采样率

Sample rate

时钟的重复率,以 Hz 为单位,用于通过模数转换器 (ADC) 启动模拟信号到数字序列的转换。采样率是数字信号 (离散序列) 样本之间时间段的倒数。

The repetition rate, measured in Hz, of the clock used to initiate the conversion of an analog signal to a digital sequence of numbers by an analog-to-digital converter (ADC). The sample rate is the reciprocal of the time period between samples of a digital signal (a discrete sequence).

采样率转换

Sample rate conversion

降低 (通过抽取) 或增加 (通过插值) 数字信号采样率的过程。

The process of either decreasing (by way of decimation) or increasing (by way of interpolation) the sample rate of a digital signal.

科学记数法

Scientific notation

工程师和科学家编写非常大和非常小的数字的一种方便而精确的方法。附录 A 详细讨论了科学记数法。

A convenient and precise way for engineers and scientists to write very large and very small numbers. Appendix A discusses scientific notation in detail.

信噪比

Signal-to-noise ratio

该数字等于所需信号的功率除以可能污染所需信号的不需要的随机噪声信号的功率之比。信噪比值越大越好。这个数字通常以 dB 为单位表示。

A number equal to the ratio of the power of the desired signal divided by the power of an undesired random noise signal that may be contaminating the desired signal. The larger the signal-to-noise ratio value, the better. This number is often expressed in units of dB.

符号幅度二进制数

Sign-magnitude binary numbers

一种使用二进制数表示正负十进制数值的方法。

A method of using binary numbers to represent both positive and negative decimal numerical values.

正弦波

Sine wave

初始值(零时间)为零的正弦波形,如图 G-5 中的虚线曲线所示。

A sinusoidal waveform whose initial value (at zero time) is zero as shown by the dashed-line curve in Figure G-5.

正弦波

Sinusoidal waves

一个通用术语,表示正弦波或余弦波。

A generic term meaning either a sine wave or a cosine wave.

信 噪 比

SNR

请参阅信噪比

See signal-to-noise ratio.

光谱

Spectrum

模拟或数字信号的频率内容。构成信号的不同频率的正弦波的组合。

The frequency content of an analog or digital signal. The combination of sinusoidal waves of different frequencies that make up a signal.

频谱分析

Spectrum analysis

测量模拟或数字信号的频率内容的过程。

The process of measuring the frequency content of an analog or digital signal.

频谱分析仪

Spectrum analyzer

接受模拟电压作为输入并在显示屏上以二维图形式显示信号频谱的电子设备。图的纵轴是信号功率电平,显示屏的横轴是频率 (Hz)。

Electronic equipment that accepts analog voltages as inputs and displays signal spectra as two-dimensional plots on a display screen. The vertical axis of the plot is signal power level and the horizontal axis of the display is frequency (Hz).

方波

Square wave

如图 G-10 所示的双电平时域波形。

A bi-level time-domain waveform as shown in Figure G-10.

Image

图 G-10方波:(a) 模拟方波;(b) 数字方波序列。

Figure G-10 Square waves: (a) analog square wave; (b) digital square wave sequence.

阻带

Stopband

由数字滤波器衰减的频率频带。图 G-7 显示了低通和高通滤波器的阻带。

The band of frequencies attenuated by a digital filter. Figure G-7 shows the stopbands of a lowpass and a highpass filter.

阻带衰减

Stopband attenuation

在滤波器输出端,位于该滤波器阻带中的频谱分量的振幅减少。阻带衰减通常以分贝为单位测量,如图 G-11 中的低通滤波器所示。在该图中,阻带衰减为 40 分贝 (dB),这意味着阻带频率范围内滤波器输入频谱分量的幅度减少了 100 倍(参见附录 B)。

The reduction in amplitude, at the output of a filter, of spectral components residing in the stopband of that filter. Stopband attenuation is typically measured in decibels as shown for a lowpass filter in Figure G-11. In that figure, the stopband attenuation is 40 decibels (dB), which means that the amplitudes of filter input spectral components in the stopband frequency range have been reduced by a factor of 100 (see Appendix B).

Image

图 G-11低通滤波器阻带衰减。

Figure G-11 Lowpass filter stopband attenuation.

阻带抑制

Stopband suppression

请参阅 阻带衰减

See stopband attenuation.

转速表

Tachometer

用于测量机械轴的转速的传感器,以每秒转数 (RPM) 为单位。

A transducer used to measure the rate of revolution, measured in revolutions per second (RPM), of a mechanical shaft.

时域

Time domain

一个形容词,用于指定信号的振幅如何随时间变化。

An adjective meant to specify how a signal’s amplitude varies as time passes.

跟踪

Trace

沉积在印刷电路板上的铜导体薄条。

A thin strip of copper conductor deposited on a printed circuit board.

收发器

Transceiver

包含接收器和发射器的通信设备。手机是收发器。

A communication device containing both a receiver and a transmitter. A cell phone is a transceiver.

晶体管

Transistor

一种基本的固态(硅)控制器件,根据输送到第三个端子的电压或电流,允许或阻止电流在两个电气端子之间流动。晶体管可以用作高速开关,可以打开或关闭,也可以用作放大器,就像在吉他放大器中一样。

A basic solid-state (silicon) control device that permits or prevents current flow between two electric terminals, based on the voltage or current delivered to a third terminal. Transistors can be used as high-speed switches, either turned on or turned off, or as amplifiers, as in guitar amplifiers.

过渡区域

Transition region

滤波器的频率响应从通带过渡到阻带的频率范围。图 G-12 说明了低通滤波器的过渡区域。过渡区域有时称为过渡带

The frequency range over which a filter’s frequency response transitions from the passband to the stopband. Figure G-12 illustrates the transition region of a lowpass filter. Transition region is sometimes called the transition band.

横向滤波器

Transversal filter

在数字滤波领域,横向滤波器是 FIR 滤波器的另一个名称。请参阅有限脉冲响应滤波器

In the field of digital filtering, transversal filter is another name for an FIR filter. See finite impulse response filter.

三角波

Triangular wave

时域模拟波形,如图 2-11 所示。

A time-domain analog waveform as shown in Figure 2-11.

Image

图 G-12Lowpass Filter 过渡区域。

Figure G-12 Lowpass filter transition region.

2 的补码二进制数

Two’s complement binary numbers

一种使用二进制数表示正负十进制数值的方法。

A method of using binary numbers to represent both positive and negative decimal numerical values.

无符号二进制数

Unsigned binary numbers

一种使用二进制数表示正十进制数值的方法。

A method of using binary numbers to represent positive decimal numerical values.

上采样

Upsample

请参见 interpolation

See interpolation.

电压

Voltage

导致电流(电子)在电路内流动的电压或电位差。电流可以为我们做功,例如转动电动机或使用灯泡产生可见光。电压有两种类型:AC(交流)电压,其电压幅度随时间变化,例如正弦波或余弦波电压;以及电压幅值保持不变的直流(直流)电压,例如汽车电池的电压。

The electric pressure, or potential difference, that causes current (electrons) to flow within an electric circuit. Current flow can do work for us, such as turn an electric motor or generate visible light using a lightbulb. There are two types of voltages: AC (alternating current) voltage, whose voltage amplitude varies as time passes, such as a sine or cosine wave voltage; and DC (direct current) voltage whose voltage amplitude remains constant, such as the voltage of a car battery.

波形

Waveform

指在水平轴上显示时间的二维图中显示的任何波动曲线。例如,图 2-3(b) 是电压波形。

Refers to any fluctuating curve shown in a two-dimensional plot having time displayed on the horizontal axis. For example, Figure 2-3(b) is a voltage waveform.

字长

Word length

二进制字中的位数。例如,二进制数据字 101101 的字长为 6。

The number of bits in a binary word. For example, the binary data word 101101 has a word length of 6.

指数

Index

一个

A

上午,13,169

AC, 13, 169

模数转换器, 50169

ADC, 50, 169

算法,169

Algorithm, 169

混叠, 78114169

Aliasing, 78, 114, 169

交流电, 1314169

Alternating current, 13, 14, 169

AM(幅度调制),4069169170

AM (amplitude modulation), 40, 69, 169, 170

放大器,169

Amplifier, 169

振幅, 10169

Amplitude, 10, 169

调幅 (AM): 4069169170

Amplitude modulation (AM), 40, 69, 169, 170

模拟滤波器,119170

Analog filters, 119, 170

模拟信号, 7170

Analog signal, 7, 170

模数转换器, 5059627193136170

Analog-to-digital converter, 50, 59, 62, 71, 93, 136, 170

抗混叠滤波器,89121170

Anti-aliasing filter, 89, 121, 170

衰减,170

Attenuation, 170

音频, 8170

Audio, 8, 170

音频音调,8

Audio tone, 8

自动调谐,55

Auto-Tune, 55

平均器, 123170

Averager, 123, 170

B

B

带阻滤波器,170

Band reject filter, 170

带通滤光片,122153170

Bandpass filter, 122, 153, 170

带阻滤波器, 122170

Bandstop filter, 122, 170

带宽, 39170

Bandwidth, 39, 170

二进制数格式

Binary number formats

定义,161

defined, 161

示例,163

examples, 163

二进制数

Binary numbers

定义,127,131,171

defined, 127, 131, 171

十六进制,176

hexadecimal, 176

十六进制表示法,166

hexadecimal notation, 166

八进制,179

octal, 179

八进制表示法,166

octal notation, 166

偏移二进制, 165179

offset binary, 165, 179

符号扩展, 165

sign-extend, 165

星等, 162181

sign-magnitude, 162, 181

二的补码,163,184

two’s complement, 163, 184

未签名, 161184

unsigned, 161, 184

字长, 161184

word length, 161, 184

位,131,171

Bit, 131, 171

广播,171

Broadcast, 171

字节、134171

Byte, 134, 171

C

C

载波频率, 69172

Carrier frequency, 69, 172

级联滤波器,172

Cascaded filters, 172

手机, 2172

Cell phone, 2, 172

中心频率,172

Center frequency, 172

奇普,134,172

Chip, 134, 172

电路, 10172

Circuit, 10, 172

时钟信号, 19172

Clock signal, 19, 172

光盘 (CD),5386139172

Compact disk (CD), 53, 86, 139, 172

复合波,34

Composite wave, 34

连续信号, 819172

Continuous signals, 8, 19, 172

连续小波变换, 109

Continuous wavelet transform, 109

相关性, 96103107109

Correlation, 96, 103, 107, 109

余弦波, 16173

Cosine wave, 16, 173

截止频率,173

Cutoff frequency, 173

每秒周期数, 26173

Cycles per second, 26, 173

D

D

DAC,173

DAC, 173

分贝,173

dB, 173

DC,12,173,174

DC, 12, 173, 174

分贝,145,173

Decibels, 145, 173

十进制数, 128173

Decimal numbers, 128, 173

《毁灭》,63,114,174

Decimation, 63, 114, 174

DFT,96,174

DFT, 96, 174

数字滤波器, 122174

Digital filter, 122, 174

数字 4345174

Digital number, 43, 45, 174

数字信号, 174

Digital signal, 174

定义 #1, 44

definition #1, 44

定义 #2, 45

definition #2, 45

示例,50

example, 50

数字信号处理,174

Digital signal processing, 174

数字信号处理器,174

Digital signal processor, 174

数模转换器,174

Digital to analog converter, 174

数字视频光盘 (DVD),139174

Digital video disk (DVD), 139, 174

直流电 (DC), 173174

Direct current (DC), 173, 174

离散傅里叶变换,174

Discrete Fourier transform, 174

定义,96

defined, 96

示例,103

example, 103

缩减采样,174

Downsample, 174

DSP,1,52,174

DSP, 1, 52, 174

E

托马斯·爱迪生,13

Edison, Thomas, 13

心电图,3

EKG, 3

心电图,3

Electrocardiogram, 3

RF 信号包络,155

Envelope of RF signal, 155

F

F

快速傅里叶变换, 96174

Fast Fourier transform, 96, 174

FFT,96

FFT, 96

过滤 器

Filters

模拟, 119170

analog, 119, 170

抗锯齿,170

anti-aliasing, 170

带拒绝,170

band reject, 170

带通, 122153170

bandpass, 122, 153, 170

轮胎停止, 122170

bandstop, 122, 170

级联,172

cascaded, 172

定义,174

defined, 174

数字, 122174

digital, 122, 174

有限脉冲响应,175

finite impulse response, 175

频率响应, 121175

frequency response, 121, 175

半频带,175

half-band, 175

高通, 122177

highpass, 122, 177

脉冲响应, 177

impulse response, 177

无限脉冲响应,177

infinite impulse response, 177

线性相位,177

linear phase, 177

低通、121150180

lowpass, 121, 150, 180

移动平均线, 123178

moving averager, 123, 178

非递归, 178

nonrecursive, 178

通带,121,179

passband, 121, 179

相位响应,180

phase response, 180

递归, 181

recursive, 181

阻带, 121182

stopband, 121, 182

过渡地区,183

transition region, 183

横向, 183

transversal, 183

有限脉冲响应滤波器,175

Finite impulse response filters, 175

FIR,175

FIR, 175

FM(频率调制),157175

FM (frequency modulation), 157, 175

傅里叶变换

Fourier transform

离散, 96174

discrete, 96, 174

法特, 96107174

fast, 96, 107, 174

频率, 25175

Frequency, 25, 175

每秒周期数,26

cycles per second, 26

弧度/秒,28

radians per second, 28

调频 (FM),41157175

Frequency modulation (FM), 41, 157, 175

频率响应, 121153175

Frequency response, 121, 153, 175

频域图 (Frequency-domain plots), 31

Frequency-domain plots, 31

G

G

增益,175

Gain, 175

千兆赫,175

Ghz, 175

千兆位 (Gb),175

Gigabits (Gb), 175

千兆字节 (GB),175

Gigabytes (GB), 175

地面,175

Ground, 175

H

H

半带滤波器,175

Half-band filter, 175

谐波失真, 37175

Harmonic distortion, 37, 175

谐波, 34175

Harmonics, 34, 175

高清电视,176

HDTV, 176

赫兹,26,176

hertz, 26, 176

赫兹,海因里希,27

Hertz, Heinrich, 27

十六进制数, 166176

Hexadecimal numbers, 166, 176

高保真,41,176

High fidelity, 41, 176

高清电视,176

High-definition television, 176

高通滤波器,122177

Highpass filter, 122, 177

I

IIR,177

IIR, 177

图像压缩, 114

Image compression, 114

脉冲响应(滤波器),177

Impulse response (filter), 177

无限脉冲响应 (IIR) 滤波器,177

Infinite impulse response (IIR) filters, 177

整数,177

Integers, 177

集成电路, 134177

Integrated circuit, 134, 177

插值, 63177

Interpolation, 63, 177

J

J

JPEG, 114, 177

JPEG, 114, 177

K

K

千赫,177

kHz, 177

千比特 (Kb),177

Kilobits (Kb), 177

千字节 (KB), 177

Kilobytes (KB), 177

KSPS,177

ksps, 177

L

L

最低有效位 (lsb), 161177

Least significant bit (lsb), 161, 177

光折射,29

Light refraction, 29

线性相位滤波器,177

Linear phase filter, 177

扬声器,8,177

Loudspeaker, 8, 177

低通滤波器,121150178

Lowpass filter, 121, 150, 178

M

M

古列尔莫·马可尼,159

Marconi, Guglielmo, 159

Marquette, 密歇根州, 8

Marquette, Michigan, 8

兆位 (Mb),178

Megabits (Mb), 178

兆字节 (MB),178

Megabytes (MB), 178

兆赫,178

Mhz, 178

微芯片,178

Microchip, 178

麦克风,10,178

Microphone, 10, 178

混合, 22178

Mixing, 22, 178

调制

Modulation

上午、4069169170

AM, 40, 69, 169, 170

调频,157,175

FM, 157, 175

最高有效位 (msb), 161178

Most significant bit (msb), 161, 178

移动平均器, 123178

Moving averager, 123, 178

MPEG、115178

MPEG, 115, 178

Msps,178

Msps, 178

N

N

啃,178

Nibble, 178

噪音, 4178

Noise, 4, 178

非递归滤波器,178

Nonrecursive filter, 178

数字

Numbers

以 10 为基数(十进制),128

base-10 (decimal), 128

base-2(二进制),130

base-2 (binary), 130

以 4 为基数,129

base-4, 129

奈奎斯特抽样准则, 628286178

Nyquist sampling criterion, 62, 82, 86, 178

O

八进制数, 166179

Octal numbers, 166, 179

偏移二进制数, 165179

Offset binary numbers, 165, 179

示波器,10,179

Oscilloscope, 10, 179

P

P

通带,121,179

Passband, 121, 179

印刷电路板,179

PC board, 179

时期,19,179

Period, 19, 179

定期抽样,49

Periodic sampling, 49

周期波, 18180

Periodic wave, 18, 180

相位响应(滤波器),180

Phase response (filter), 180

像素、134176180

Pixel, 134, 176, 180

压力波,8

Pressure wave, 8

印刷电路板 180

Printed circuit board, 180

Q

Q

量化,180

Quantization, 180

R

R

弧度/秒, 28180

Radians per second, 28, 180

射频,155,181

Radio frequency, 155, 181

递归滤波器,181

Recursive filter, 181

折射,29

Refraction, 29

RF,155,181

RF, 155, 181

RF 信号包络,155

RF signal envelope, 155

理查兹,基思,39

Richards, Keith, 39

里氏震级,147

Richter scale, 147

S

S

样品,181

Sample, 181

采样频率,181

Sample frequency, 181

采样率、526271181

Sample rate, 52, 62, 71, 181

采样率转换, 63181

Sample rate conversion, 63, 181

采样,49

Sampling, 49

采样频率,62

Sampling frequency, 62

科学记数法, 27141181

Scientific notation, 27, 141, 181

信号

Signal

模拟, 7170

analog, 7, 170

连续, 172

continuous, 172

数字、4550

digital, 45, 50

信噪比,181

Signal-to-noise ratio, 181

符号大小二进制数, 162181

Sign-magnitude binary numbers, 162, 181

正弦波, 14181

Sine wave, 14, 181

正弦波, 13181

Sinusoidal waves, 13, 181

信噪比 (SNR),181

SNR, 181

声音, 886146

Sound, 8, 86, 146

声级 (dB),146

Sound levels (dB), 146

光谱, 252968181

Spectrum, 25, 29, 68, 181

频谱分析

Spectrum analysis

定义,182

defined, 182

示例,103

example, 103

频谱分析仪,182

Spectrum analyzer, 182

方波, 19182

Square wave, 19, 182

阻带, 121182

Stopband, 121, 182

阻带衰减,182

Stopband attenuation, 182

T

T

转速表,183

Tachometer, 183

特斯拉,尼古拉,13,159

Tesla, Nikola, 13, 159

时域,183

Time domain, 183

时域图 , 29

Time-domain plots, 29

按键式电话,58

Touch-tone telephone, 58

追踪,180,183

Trace, 180, 183

收发器,183

Transceiver, 183

晶体管,183

Transistor, 183

过渡区域,183

Transition region, 183

横向滤波器,183

Transversal filter, 183

三角波, 20183

Triangular wave, 20, 183

二进制补码二进制数,163,184

Two’s complement binary numbers, 163, 184

U

无符号二进制数, 161184

Unsigned binary numbers, 161, 184

上采样,184

Upsample, 184

V

V

电压,10,184

Voltage, 10, 184

上午、1314170

AC, 13, 14, 170

DC,12,173

DC, 12, 173

W

Wave

复合材料, 34

composite, 34

余弦, 16173

cosine, 16, 173

定期, 18180

periodic, 18, 180

压力, 8

pressure, 8

正弦, 14181

sine, 14, 181

正弦, 13181

sinusoidal, 13, 181

正方形, 19182

square, 19, 182

三角形, 20183

triangular, 20, 183

波形, 10184

Waveform, 10, 184

小波, 107

Wavelets, 107

乔治·西屋公司,13

Westinghouse, George, 13

字长, 161184

Word length, 161, 184

Image
Image
Image